Problem

Write an interactive C++ program that computes and outputs the mean and standard deviati...

Write an interactive C++ program that computes and outputs the mean and standard deviation of a set of four integer values that are input by the user. (If you did Programming Problem 2 in Chapter 3, then you can reuse much of that code here.) The mean is the sum of the four values divided by 4, and the formula for the standard deviation is

where n = 4, xi refers to each of the four values, and is the mean. Although the individual values are integers, the results are floating-point values. Be sure to use proper formatting and appropriate comments in your code. Provide appropriate prompts to the user. The output should be labeled clearly and formatted neatly.

Step-by-Step Solution

Solution 1

Program plan:

- Read four integers from the user.

- Calculates mean, using this find standard deviation.

- Display mean and standard deviation of four numbers.

Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT