Question
Write a program to compute the sum, mean, and population standard deviation of a list of 5 numbers. First, have the user supply five numbers
Write a program to compute the sum, mean, and population standard deviation of a list of 5 numbers. First, have the user supply five numbers via the keyboard. For example: 1 2 3 4 5 Then, compute the sum of the numbers. In this case: 1 + 2 + 3 + 4 + 5 = 15 The mean is another word for the simple average: 15 / 5 = 3 To calculate the population standard deviation takes a few steps. First, for each inputted value, compute the difference between the mean and that number: (1-3) = -2, (2-3) = -1, (3-3) = 0, (4-3) = 1, (5-3) = 2 Then, add up the square of these differences: (-2)2 + (-1)2 + (0)2 + (1)2 + (2)2 = 4 + 1 + 0 + 1 + 4 = 10 Then divide this sum by the number of inputs: 10 / 5 = 2 And finally take the square root: 2 ~ 1.41 So, an example run of your program, given the above sample inputs, would look like the following: Enter five numbers: 1 2 3 4 5 Sum: 15.00 Mean: 3.00 Population Standard Deviation: 1.41 You should express the sum, mean, and population standard deviation using exactly two decimal places (rounding where necessary).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started