Mean and standard deviation. Write a program that reads a set of floating-point

Chapter 4, Problem P4.17

(choose chapter or problem)

Mean and standard deviation. Write a program that reads a set of floating-point datavalues. Choose an appropriate mechanism for prompting for the end of the data set.When all values have been read, print out the count of the values, the average, andthe standard deviation. The average of a data set {x1, . . ., xn} is x x n i = , where = x x + + x i 1 n is the sum of the input values. The stan dard deviation issx xni = ( ) 21However, this formula is not suitable for the task. By the time the program hascomputed x , the individ ual xi are long gone. Until you know how to save thesevalues, use the numerically less stable formulasx xni n i = ( ) 2 1 21You can compute this quantity by keeping track of the count, the sum, and the sumof squares as you process the input values.

Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.

Becoming a subscriber
Or look for another answer

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back