// // Filename: pgm4_1c.cpp // // Description: Arrays #3, Computing Statistics from an Array. // // ENSC 104: Digital Computer Programming // // Instructor: Dr. Walsh // // Section: 2 // // Date Created: 03/28/98 // Last Modified: 03/28/98 // // Name: N/A // #include #include const int NUM_ELEMENTS = 10; main() { int score[NUM_ELEMENTS] = { 90, 50, 77, 54, 87, 93, 86, 74, 66, 100 }; float max; float min; float mean; float std_dev; float sum = 0.0; float ssq = 0.0; max = min = score[0]; for( int i=0; i score[i] ) min = score[i]; } cout << endl; mean = sum/NUM_ELEMENTS; std_dev = sqrt( ( (ssq - sum*sum/NUM_ELEMENTS)/(NUM_ELEMENTS -1 ) ) ); cout << "The Max is: " << max << endl; cout << "The Min is: " << min << endl; cout << "The Mean score is: " << mean << endl; cout << "The Standard deviation is: " << std_dev << endl; return 0; }