Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/ * * File: Roster.h * * Purpose: This file gives the full definition of the class Roster. * / #ifndef _ _ CSCI 3
File: Roster.h Purpose: This file gives the full definition of the class Roster. #ifndef CSCIROSTER #define CSCIROSTER #include #include "student.h using namespace std; class Roster public: a value constructor, the parameter is the course name Create an empty roster, ie studentNum for a specific course Rosterstring courseName; This function reads student information from a file The parameter is a file name postcondition: students contains student information read from the file studentNum is the number of students read from the file void readStudentRecordstring filename; This function returns the number of students in the class roster postcondition: the studentNum value is returned int GetStudentCount const; This function determines whether there is a student with id in the class roster postcondition: if there is a student in class with this id true is returned Otherwise, false is returned bool isValidstring id const; This function displays all the information of one student, one value per line This function also displays the total score and letter grade of the student with the id given precondition: a valid user id is provided postcondition: All information of the student with the given id is displayed, one value per line with label void ShowOneStudentstring id const; This function prints out all the information exclude total score and letter grade for all the students in the class The information is display in a table format, one student per row friend ostream & operatorostream& os const Roster& oneClass; Add your functions here if necessary private: static const int MAXNUM ; The maximum # of students of a class Class constant. All objects share the same copy string courseName; THe name of the course int studentNum; Actual Student # Student studentsMAXNUM; The array of student objects ; #endif
File: Roster.h
Purpose: This file gives the full definition of the class Roster.
#ifndef CSCIROSTER
#define CSCIROSTER
#include
#include "student.h
using namespace std;
class Roster
public:
a value constructor, the parameter is the course name
Create an empty roster, ie studentNum for
a specific course
Rosterstring courseName;
This function reads student information from a file
The parameter is a file name
postcondition:
students contains student information read from the file
studentNum is the number of students read from the file
void readStudentRecordstring filename;
This function returns the number of students in the class roster
postcondition: the studentNum value is returned
int GetStudentCount const;
This function determines whether there is a student with id in the class roster
postcondition: if there is a student in class with this id true is returned
Otherwise, false is returned
bool isValidstring id const;
This function displays all the information of one student, one value per line
This function also displays the total score and letter grade of the student with the id given
precondition: a valid user id is provided
postcondition: All information of the student with the given id is displayed, one value per line with label
void ShowOneStudentstring id const;
This function prints out all the information exclude total score and letter grade for
all the students in the class
The information is display in a table format, one student per row
friend ostream & operatorostream& os const Roster& oneClass;
Add your functions here if necessary
private:
static const int MAXNUM ; The maximum # of students of a class
Class constant. All objects share the same copy
string courseName; THe name of the course
int studentNum; Actual Student #
Student studentsMAXNUM; The array of student objects
;
#endif
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started