I have a project that has four classes descending. Person is the first class, CollegeEmployee,and Student are classes that descend from the class Person. The class Faculty descends from CollegeEmployee and has a Boolean field that indicated whether the Faculty member is tentured, as well as methods that override the CollegeEmployee methods to accept and display this additional piece of information. I don't understand how to do the Boolean or what is tentured. I need help on the class Faculty.
#include <iostream>
#include <cstdlib>
using namespace std;
class Person
{
protected:
char m_FirstName[30];
char m_LastName[30];
public:
void SetFirstName(char []);
char * GetFirstName(void);
void SetLastName(char []);
char * GetLastName(void);
};
class Student : public Person
{
protected:
char m_NID[15];
float m_Grade;
public:
void SetNID(char []);
char * GetNID(void);
void SetGrade(float);
float GetGrade(void);
};
float AverageGrade(Student [], int);
int MaximumGradeStudent(Student [], int);
int main()
{
int i, n;
char firstName[30];
char lastName[30];
char studentNID[15];
float studentGrade;
float avg;
int max = 0;
cout << "Enter the number of students: ";
cin >> n;
Student *studentInfo = new Student[n];
for (i = 0; i < n; i++)
{
cout << "Student #" << i+1 << endl;
cout << "Enter the student's first name: ";
cin >> firstName;
cout << "Enter the student's last name: ";
cin >> lastName;
cout << "Enter the student's NID: ";
cin >> studentNID;
cout << "Enter the student's grade: ";
cin >> studentGrade;
studentInfo[i].SetFirstName(firstName);
studentInfo[i].SetLastName(lastName);
studentInfo[i].SetNID(studentNID);
studentInfo[i].SetGrade(studentGrade);
}
avg = AverageGrade(studentInfo, n);
max = MaximumGradeStudent(studentInfo, n);
cout << "The average grade is: " << avg << endl;
cout << "The student with the highest grade is: "
<< studentInfo[max].GetFirstName() << " "
<< studentInfo[max].GetLastName()<< " " << "NID: "
<< studentInfo[max].GetNID() << " " << "Grade: "
<< studentInfo[max].GetGrade() << endl;
delete [] studentInfo;
system("PAUSE");
}
float AverageGrade(Student students[], int num)
{
float average = 0;
for (int i = 0; i < num; i++)
{
average = average + students[i].GetGrade();
}
average = average/(double)num;
return average;
}
int MaximumGradeStudent(Student students[], int num)
{
int i, place;
float maxGrade = 0;
for (i = 0; i < num; i++)
{
if ((students[i].GetGrade()) > maxGrade)
{
maxGrade = students[i].GetGrade();
place = i;
}
}
return place;
}
void Person::SetFirstName(char firstName[])
{
strcpy(m_FirstName,firstName);
}
char * Person::GetFirstName(void)
{
return m_FirstName;
}
void Person::SetLastName(char lastName[])
{
strcpy(m_LastName,lastName);
}
char * Person::GetLastName(void)
{
return m_LastName;
}
void Student::SetGrade(float studentGrade)
{
m_Grade = studentGrade;
}
float Student::GetGrade(void)
{
return m_Grade;
}
void Student::SetNID(char studentNID[])
{
strcpy(m_NID,studentNID);
}
char * Student::GetNID(void)
{
return m_NID;
}
class CollegeEmployee : Person
{
private:
int deptName; double annualSal; double SS;
char m_NID[3];
double m_deptName;
double m_annualSal;
double m_SS;
void SetNID(char[]);
char * GetNID(void);
void SetdeptName(double);
void SetannualSal(double);
void SetSS(double);
};
int deptName(CollegeEmployee[],int);
double annualSal(CollegeEmployee[],int);
double SS(CollegeEmployee[], int);
int main ()
{