//
calculate average of all response values
void mean( const int
answer[], int arraySize )
{
int total = 0;
cout << "********\n Mean\n********\n";
// total response values
for ( int i = 0; i < arraySize; i++ )
total += answer[ i ];
// format and output results
cout << fixed << setprecision( 4 );
cout << "The
mean is the average value of the data\n"
<< "items.
The mean is equal to the total of\n"
<< "all
the data items divided by the number\n"
<< "of
data items (" << arraySize
<< ").
The mean value for\nthis run is: "
<< total << "
/ " << arraySize << " = "
<< static_cast< double >(
total ) / arraySize
<< "\n\n";
} // end function mean