cuong5985,

so you're asking what the code should look like inside the Average Function and the StandardDeviation Function (given 4 numbers provided by the user)?

Your <computeStats > function would be something simple like this:

-----------------------------------------------------------------------------------------------------------

void computeStats (double s1, double s2, double s3, double s4, double& avg, double& stdev)

{

// Precondition: The parameters s1, s2, s3, and s4 contain four numbers.

// Postcondition: The parameters avg and stdev have been set to

// the average and standard deviation, respectively, of the four numbers.

avg = average (s1, s2, s3, s4);

stdev = standardDeviation (s1, s2, s3, s4, avg);

}

------------------------------------------------------------------------------------

The average is the sum of all numbers divided by the number count.

example input:

1 39 84 23

Average = (1+39+84+23) / 4

Average = 36.75

------------------------------------------------------------------------------------

The Standard-Deviation is a little more complicated, and I don't have that info with me at the current moment, so I can get back to you on that. Most likely in the next day or so.

Hope this helps a little for you. I'll get back to you asap for more help.

cnesb860

so you're asking what the code should look like inside the Average Function and the StandardDeviation Function (given 4 numbers provided by the user)?

Your <computeStats > function would be something simple like this:

--------------------------

void computeStats (double s1, double s2, double s3, double s4, double& avg, double& stdev)

{

// Precondition: The parameters s1, s2, s3, and s4 contain four numbers.

// Postcondition: The parameters avg and stdev have been set to

// the average and standard deviation, respectively, of the four numbers.

avg = average (s1, s2, s3, s4);

stdev = standardDeviation (s1, s2, s3, s4, avg);

}

--------------------------

The average is the sum of all numbers divided by the number count.

example input:

1 39 84 23

Average = (1+39+84+23) / 4

Average = 36.75

--------------------------

The Standard-Deviation is a little more complicated, and I don't have that info with me at the current moment, so I can get back to you on that. Most likely in the next day or so.

Hope this helps a little for you. I'll get back to you asap for more help.

cnesb860