Question: Need Help with the To Do Section. ( Data Structures ) 1 . / / Specification file for the GeneralStudent class / / See below
Need Help with the To Do Section. Data Structures
Specification file for the GeneralStudent class
See below the section you need to complete.
#ifndef GENERALSTUDENTH
#define GENERALSTUDENTH
#include
using namespace std;
class GeneralStudent
protected:
string name; Student name
string idNumber; Student ID
int yearAdmitted; Year student was admitted
public:
Default or noargument constructor initializes data member variables.
GeneralStudent
name ;
idNumber ;
yearAdmitted ;
Constructor with argument sets the data member variables values.
GeneralStudentstring n string id int year setn id year;
The set function sets the attribute data or data member variables.
void setstring n string id int year
name n; Assign the name
idNumber id; Assign the ID number
TO DO: Complete this section
Validate the year below such that the yearAdmitted is
set to years between and else set it to
Accessor functions used to access, get, or retrieve data member
variable values.
const string getName const return name;
const string getIdNum const return idNumber;
int getYearAdmitted const return yearAdmitted;
Pure virtual function. This function MUST be implemented in the
ComputerScienceStudent derived class.
virtual int getRemainingHours const ;
;
#endif
Specification file for the ComputerScienceStudent class
See below the sections you need to complete.
#ifndef COMPUTERSCIENCESTUDENTH
#define COMPUTERSCIENCESTUDENTH
#include "GeneralStudent.h
Constants for required hours
const int MATHHOURS ; Math hours
const int CSHOURS ; Computer science hours
const int GENEDHOURS ; General Ed hours
class ComputerScienceStudent : public GeneralStudent
private:
int mathHours; Hours of math taken
int csHours; Hours of Computer Science taken
int genEdHours; Hours of general education taken
public:
Default Constructor
ComputerScienceStudent : GeneralStudent
mathHours ;
csHours ;
genEdHours ;
Constructor
ComputerScienceStudentstring n string id int year :
GeneralStudentn id year
mathHours ;
csHours ;
genEdHours ;
TO DO: Mutator functions declarations. You need to implement each of
of these functions in the ComputerScienceStudent.cpp file following
the example I have provided for the setMathours function.
void setMathHoursint mh;
void setCsHoursint csh;
void setGenEdHoursint geh;
TO DO: Complete this section
Add below the definition or implementation of the accessor
functions as inline functions for the private members of this class
or for each of the above mutator functions. Ensure that these
functions do not change the data member values
Overridden getRemainingHours function, defined in
ComputerScienceStudent.cpp file.
virtual int getRemainingHours const;
TO DO: Implement the following functions in the
ComputerScienceStudentcpp file.
void getData; Get the values for all the data member variables.
void displayData; Display the values for all the data member
variables and the remaining hours to graduate.
;
#endif
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
