Home‎ > ‎Assignments‎ > ‎

## Some Statistical Analysis

Write a program that will calculate and print the sum, mean, variance, and standard deviation of 7 numbers. The numbers must be input as data. This input data must also be printed by the program.

If your seven numbers input have been named A, B, C, D, E, F, G, then the variance may be computed as:

variance = [(A-mean)2 + (B-mean)2 + ... + (G-mean)2]/6

and the standard deviation is the square root of the variance. (Hint: If you can't figure out how to get the square root in C++ leave it out at first.  You can always add to your program later, once it works without it.)

Run your program three times, using three different sets of data:

Run I: 12, 22, 34, 43, 45, 54, 99

Run II: 1.0, 1.5, 2.5, -9.3, 0, -1.0, 3.0

Run III: Any 7 numbers of your own choosing.

Sample interactive console window produced by running the program:

 *** PERSONAL / COURSE / ASSIGNMENT  HEADER INFORMATION *** I will give you the sum, mean, and standard deviation of any seven numbers.Type each number, followed by the enter key.Number =?12Number =?22Number =?34Number =?43Number =?45Number =?54Number =?99You have entered the following:12223443455499The sum is 309The mean is 44.1429The variance is 789.1436The standard deviation is 28.0917