/****************************************************************************** Lab Exercise #3 -- skeleton ******************************************************************************/ using namespace std; #include #include /*----------------------------------------------------------------------------- Name: main Purpose: Compute statistics for a set of exam scores. Input: The set of exam scores Output: The high and low exam scores, and the average score -----------------------------------------------------------------------------*/ int main() { const int MaxScore = 100, // The maximal exam score possible MinScore = 0; // The minimal exam score possible int Number = 0, // The number of exam scores in the set Total = 0, // The total of all exam scores HighScore = MinScore, // The current high exam score LowScore = MaxScore, // The current low exam score Score; // The current exam score (input value) double Average; // The average of all exam scores cout << "\nAt the prompt, please enter each exam score (ctrl-d to halt)\n\n"; for (;;) { cout << "Exam score: "; cin >> Score; if (!cin.good()) break; if ( /* incomplete */ ) { // incomplete } else { cout << "\n*** Invalid score -- ignored ***\n\n"; } } if ( /* incomplete */ ) { // incomplete cout << "\n\nStatistics for the set of exam scores\n\n"; cout << "\tHigh score: " << setw(3) << HighScore << endl; cout << "\tLow score: " << setw(3) << LowScore << endl << endl; cout << "\tNumber of scores: " << Number << endl; cout << "\tAverage of all scores: " << Average << endl << endl; } else { cout << "\n\n*** Empty set -- no statistics computed ***\n\n"; } }