Error is here:
vector<Graduate *> graduates;
graduates.push_back(new AliceUniversity(identifier,id,salary,average));
Grandparent class:
Graduate::Graduate(char identifier,
long id,
int salary,
double average)
: _identifier(identifier),
_id(id),_salary(salary),
_average(average)
{
}
Parent class:
UniversityGraduate::UniversityGraduate(char identifier,
long id,
int salary,
double average)
: Graduate(identifier,id,salary,average)
{
}
Actual/child class:
AliceUniversity::AliceUniversity(char identifier,
long id,
int salary,
double average)
: UniversityGraduate(identifier,id,salary,average)
{
_graduateNum++;
_sumOfGrades += average;
_avrA = getAverage();
}
I know it's a long shot, I cant write the entire code here…
= 0;
). – Ruthannruthanne