//Devin Scheu CS1A Chapter 3, P. 143, #3
//
/**************************************************************
*
* CALCULATE AVERAGE TEST SCORE
* ____________________________________________________________
* This program calculates the average of five test scores
* provided by the user and displays the result.
*
* Computation is based on the formula:
* average = (score1 + score2 + score3 + score4 + score5) / 5
* ____________________________________________________________
* INPUT
* score1 : First test score (as a double)
* score2 : Second test score (as a double)
* score3 : Third test score (as a double)
* score4 : Fourth test score (as a double)
* score5 : Fifth test score (as a double)
*
* PROCESSING
* sum : The sum of the five test scores
*
* OUTPUT
* average : The average of the five test scores
*
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
//Variable Declarations
double score1; //INPUT - First test score (as a double)
double score2; //INPUT - Second test score (as a double)
double score3; //INPUT - Third test score (as a double)
double score4; //INPUT - Fourth test score (as a double)
double score5; //INPUT - Fifth test score (as a double)
double sum; //PROCESSING - The sum of the five test scores
double average; //OUTPUT - The average of the five test scores
//Prompt for Input
cout << "Enter the first test score: ";
cin >> score1;
cout << "\nEnter the second test score: ";
cin >> score2;
cout << "\nEnter the third test score: ";
cin >> score3;
cout << "\nEnter the fourth test score: ";
cin >> score4;
cout << "\nEnter the fifth test score: ";
cin >> score5;
//Calculate Sum
sum = score1 + score2 + score3 + score4 + score5;
//Calculate Average
average = sum / 5.0;
//Output Result
cout << fixed << setprecision(1) << "\nThe average test score is: " << average << endl;
} //end of main()