First off, If there's any missing information, or you need to know more, please let me know. I'm not an experienced programmer by any means, and this mostly a project I'm working on for a university course.
This is my function definition:
void DispReport(string names[], int IDs[], int grades[][8], int numStudents, int numClasswork, int numQuizzes) {
The job of this function is to display a full table of student names with their ID numbers and grades. At the start, the function will display headers of "Name", "ID", and so on. Then display a continuous line of hyphens as a border underneath. After that it will start extracting and displaying the names, IDs and grades. This is the loop involved (I realize there's a lot of repetitiveness, sorry):
int Qmin, Qmax, CWmin, CWmax, Total;
for(i = 0; i < numStudents; i++){
cout << i+1 << ".";
cout << setw(11) << names[i];
cout << setw(11) << IDs[i];
//Display Quizzes, and Qmin ,Qmax, and Qavg
for(j = 0; j < numQuizzes; j++){
cout << setw(11) << grades[i][j];
if(grades[i][j] < grades[i][j+1])
Qmin = grades[i][j];
else
Qmax = grades[i][j];
};
cout << setw(11) << Qmin;
cout << setw(11) << Qmax;
cout << setw(11) << (Qmin + Qmax)/2;
//Display Classwork, and CWmin, CWmax, and CWavg
for(j = numQuizzes; j < (numQuizzes + numClasswork); j++){
cout << setw(11) << grades[i][j];
if(grades[i][j] < grades[i][j+1])
CWmin = grades[i][j];
else
CWmax = grades[i][j];
};
cout << setw(11) << CWmin;
cout << setw(11) << CWmax;
cout << setw(11) << (CWmin + CWmax)/2;
};
Running this loop results in nothing, however. It runs once, outputting the very first line, "1.", pauses for a second, then the program terminates. Nothing. I checked to ensure that the function had actually receive the arrays I passed to it, through cout << names[different indexes to check different names]
and it was all there. The loop however, wouldn't display them, and I'm not getting any error messages. Any ideas?