One side note, when I was writing the test app, I had to set Num_Students after I read from the input file. My read from the input file looks like the following: (there is some debug still so I can see that it is doing something)
printf("main: reading grades.txt\n");
ifstream infile("grades.txt");
if (!infile.is_open())
printf("main: Failed to open grades.txt\n");
else{
while(!infile.eof() && i < Num_grades){
infile >> grades[i].ID;
infile >> grades[i].q1;
infile >> grades[i].q2;
infile >> grades[i].e1;
infile >> grades[i].e2;
infile >> grades[i].assg1;
infile >> grades[i].assg2;
infile >> grades[i].assg3;
if (! infile.eof()){
cout << "main: grades[" << i << "].ID=" << grades[i].ID << endl;
i++;
}
}
}
infile.close();
Num_Students = i;
Please make any changes from the above that make sense to you.
We need to get your code compiled and running. If you want to work on it some, go ahead. When I first started working with your file, I commented out anything that had a compile error that I couldn't "just fix". Then I started running it and got the functionality that was implemented working. Then I started adding the functionality that I had commented out. (Its an iterative approach to development.)
If you get stuck:
Compile your file.
Post the entire file you just compiled in code=c++ tags
Post the entire error list from that compile in code tags