Write an application namedCollegeList that declares an array of four "regular" CollegeEmployees, three Falulty, and seven Students. Prompt the user to specify which type of person's data will be entered('C'F'S') or allow user to quit('Q') . While user chooses to continue accept data entry for approate type of Person. If user attempts to enter data for more than four CollegeEmployeed, three Faculty, or seven Students, display error message. When user quits, display report on screen listing each group of Persons under appropriate heating "College Employee"Faculty","Students". If user has not entered data for one or more types of Persons during session, display an appropriat message under appropriate heading.
I need help with the arrays and everything else in instructions It would help to have a start on the arrays and the the users prompt (CFSor Q) and I could complete the rest. Thanks

#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;

I would start not by trying to do the assignment, but by trying to break down the assignment into generic programming problems. "How do I get input from the user?" "How do I make an array?", etc. We can help you with these sorts of things (after you Google for some tutorials, of course). Once you have these building blocks, the assignment should be easy to complete.

This article has been dead for over six months. Start a new discussion instead.