//Devin Scheu CS1A Chapter 2, P. 81, #5
//
/**************************************************************
*
* CALCULATE AVERAGE OF FIVE NUMBERS
* ____________________________________________________________
* This program calculates the average of five numbers by summing
* them and dividing by the count of numbers.
*
* Computation is based on the formula:
* average = sum / 5
* ____________________________________________________________
* INPUT
* num1 : First number (as an integer: 28)
* num2 : Second number (as an integer: 32)
* num3 : Third number (as an integer: 37)
* num4 : Fourth number (as an integer: 24)
* num5 : Fifth number (as an integer: 33)
*
* PROCESSING
* sum : The sum of num1, num2, num3, num4, and num5
*
* OUTPUT
* average : The average of the five numbers
*
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
//Variable Declarations
int num1; //INPUT - First number (as an integer: 28)
int num2; //INPUT - Second number (as an integer: 32)
int num3; //INPUT - Third number (as an integer: 37)
int num4; //INPUT - Fourth number (as an integer: 24)
int num5; //INPUT - Fifth number (as an integer: 33)
int sum; //PROCESSING - The sum of num1, num2, num3, num4, and num5
double average; //OUTPUT - The average of the five numbers
//Variable Initialization
num1 = 28;
num2 = 32;
num3 = 37;
num4 = 24;
num5 = 33;
//Calculate Sum
sum = num1 + num2 + num3 + num4 + num5;
//Calculate Average
average = sum / 5.0;
//Output Result
cout << fixed << setprecision(2) << "The average is: " << average << endl;
} //end of main()