// This program calculates an average test score given individual test scores.
// Input: Interactive - Student Test Scores
// Output: Number of Students taking the test and the test score average
// Declare variables
// This is the work done in the housekeeping() function
// Get user input to control loop
cout << "Enter number of students: ";
cin >> numStudents;
// Initialize accumulator variable to 0
testTotal = 0;
// This is the work done in the detailLoop() function
// Loop for each student
// Calculate average test score
average = testTotal / stuCount;
// Output number of students and average test score
cout << "Number of Students: " << stuCount << endl;
cout << "Average Test Score: " << average << endl;
Since you are trying to calculate the average of all test scores of a class, you may need to use arrays. I see that you declare int testScore and int stuCount, but does every student have the same test score?
This is something you may want to consider
//Create an array testScore that corresponds to how many students there are in the classroom
Now, your testTotal must be all of the testScore variables added together. The adding is done inside the loop.
Also, what's the difference between your int numStudents and int stuCount? It seems somewhat redundant to me... Judging by the names, are they meant to have the same value? If so, you only need one of them.