//Xinnuo Wang CS1A chapter 2, P.81, # 4
//
/*******************************************************************************
*
* COMPUTE THE AVERAGE OF VALUES
* _____________________________________________________________________________
* This program compute the average of a series of values, you add the values up
* and then divide the sum by the number of values. Write a program that stores
* the following values in five different variables: 28, 32, 37, 24, and 33. The
* program should first calculate the sum of these five variables and store the
* result in a separate variable named sum. Then, the program should divide the
* sum variable by 5 to get the average. Display the average on the screen.
*
* Computation is based on the formula:
* Sum = Numb1 + Numb2 + Numb3 + Numb4 + Numb5
* Average = Sum / 5
* _____________________________________________________________________________
* INPUT
* numb1 : The value of the first number
* numb2 : The value of the second number
* numb3 : The value of the third number
* numb4 : The value of the forth number
* numb5 : The value of the fivth number
*
* OUTPUT
* sum : The sum of the five numbers
* average value : Average of the five numbers
*
******************************************************************************/
#include <iostream>
using namespace std;
int main()
{
int numb1; //INPUT - The value of the first number
int numb2; //INPUT - The value of the second number
int numb3; //INPUT - The value of the third number
int numb4; //INPUT - The value of the forth number
int numb5; //INPUT - The value of the fivth number
int sum; //OUTPUT - The sum of the five numbers
int averageValue; //OUTPUT - The average of the five numbers
//
// Initialize Program variables
numb1 = 28;
numb2 = 32;
numb3 = 37;
numb4 = 24;
numb5 = 33;
//
// Compute the sum of the five numbers
sum = numb1 + numb2 + numb3 + numb4 + numb5;
//
// Compute the average of the five numbers
averageValue = sum/5;
//
//Output Result
cout << "The average value of the five numbers is: "<< averageValue <<endl;
return 0;
}