//Zachary Abdollahi CS1A Chapter 2, P. 81, #5
//
/****************************************************************************
*
* COMPUTE AVERAGE OF VALUES
* __________________________________________________________________________
* This program stores five integer values in separate variables,
* calculates their sum, and then calculates and displays the average.
*
* Computation is based on the formulas:
* Sum = val1 + val2 + val3 + val4 + val5
* Average = Sum / 5.0
* __________________________________________________________________________
* INPUT
* val1 : First integer value (28)
* val2 : Second integer value (32)
* val3 : Third integer value (37)
* val4 : Fourth integer value (24)
* val5 : Fifth integer value (33)
*
* OUTPUT
* sum : Total sum of the five values
* average : Average of the five values
*
**************************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float val1; //INPUT - First integer value
float val2; //INPUT - Second integer value
float val3; //INPUT - Third integer value
float val4; //INPUT - Fourth integer value
float val5; //INPUT - Fifth integer value
float sum; //OUTPUT - Total sum of all values
float average; //OUTPUT - Average of all values
// Initialize Program Variables
val1 = 28;
val2 = 32;
val3 = 37;
val4 = 24;
val5 = 33;
// Compute Sum and Average
sum = val1 + val2 + val3 + val4 + val5;
average = sum / 5.0;
// Output Result
cout << "The sum of the values is: " << sum << endl;
cout << "The average of the values is: " << average << endl;
return 0;
}