Question: c++ please help! code so far... got stuck running out of time... #include #include using namespace std; class Student { private: string firstName; string lastName;
c++ please help! code so far... got stuck running out of time...
#include
#include
using namespace std;
class Student
{
private:
string firstName;
string lastName;
int grade;
int totalFees;
public:
Student(string f,string l,int g)
{
firstName=f;
lastName=l;
grade=g;
totalFees=0;
}
friend ostream& operator
{
o
return o;
}
Student& operator+=(double fee)
{
totalFees+=fee;
}
bool operator==(string compareLast)
{
bool isEqual=false;
if(lastName==compareLast)
isEqual=true;
return isEqual;
}
bool operator==(int compareGrade)
{
bool isEqual=false;
if(grade==compareGrade)
isEqual=true;
return isEqual;
}
};
class Athlete
{
private:
string firstName;
string lastName;
string sport;
static double athleticFee;
public:
Athlete(string f,string l, string s)
{
firstName=f;
lastName=l;
sport=s;
}
friend ostream& operator
{
o
return o;
}
bool operator==(string compareSport)
{
bool isEqual=false;
if(sport==compareSport)
isEqual=true;
return isEqual;
}
};
double Athlete::athleticFee=125.50;
void displayMenu()
{
cout
cout
cout
cout
cout
cout
cout
cout
}
addStudent(vector
{
string firstName;
string lastName;
int grade;
char playsSport;
string sport;
cout
cin>>firstName;
cout
cin>>lastName;
cout
cin>>grade;
cout
cin>>playsSport;
if(playsSport=='Y')
cout
cin>>sport;
}
displayStudents(vector
{
}
displayOneStudent(vector
{
}
displayAthletes(vector
{
}
displayStudentsByGrade(vector
{
}
displayStudentsBySport(vector
{
}
int main()
{
int selection;
vector
vector
while(selection!=7){
displayMenu();
cin>>selection;
switch(selection){
case 1:
addStudent(studentVec, athleteVec);
case 2:
displayStudents(studentVec);
case 3:
displayOneStudent(studentVec);
case 4:
displayAthletes(athleteVec);
case 5:
displayStudentsByGrade(studentVec);
case 6:
displayStudentsBySport(studentVec);
case 7:
exit;
}
}
}



Name: Date: CIS 230 LL input must be validated (except string input for name and sport) and all output must be formatted. You will be writing one program as described below: Student class with private data for first name, last name, grade (9-12), and total fees. Include a non-default constructor that requires first name, last name, and grade. Your constructor must also initialize total fees to 0. You may NOT use a default constructor! Overload the following operators + This will add a fee to a student's total fee. This will output a student's grade, full name and total fees.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
