Using Parallel Arrays
Student data consisting of a name, the semesters the student
has been in school, and a score is stored in a file
scores.dat. E.g.
Smith 2 70
Johnson 7 92
Young 8 75
Cohen 4 92
Bird 5 83
Write a program to read this data into parallel arrays:
const int MAX_STDNTS = 30; // Global const
string names[MAX_STDNTS];
int semesters[MAX_STDNTS];
int scores[MAX_STDNTS];
int num_stdnts;
and then
1. print the name/semester/score arrays:
NAME SEM SCORE
Smith 2 70
Johnson 7 92
Young 8 75
Cohen 4 92
Bird 5 83
2. print the student(s) with the highest score:
High score 92
Achieved by:
Johnson (sem. 7)
Cohen (sem. 4)
Functions:
get_data to read from the file into the parallel arrays
print_data to print the data in the arrays
highest to return the highest score
Print_achievers to print the students who recieve the highest score