Programming Exercise 5.45 computes the standard deviation of numbers. This exercise uses a different but equivalent formula
Question:
Programming Exercise 5.45 computes the standard deviation of numbers. This exercise uses a different but equivalent formula to compute the standard deviation of n numbers.
To compute the standard deviation with this formula, you have to store the individual numbers using an array, so that they can be used after the mean is obtained.Your program should contain the following methods:/** Compute the deviation of double values */public static double?deviation(double[] x)/** Compute the mean of an array of double values */public static double?mean(double[] x)Write a test program that prompts the user to enter ten numbers and displays the mean and standard deviation, as shown in the following sample run:
In business applications, you are often asked to compute the mean and standard deviation of data. The mean is simply the average of the numbers. The standard deviation is a statistic that tells you how tightly all the various data are clustered around the mean in a set of data.
For example, what is the average age of the students in a class? How close are the ages? If all the students are the same age, the deviation is 0.
Write a program that prompts the user to enter ten numbers, and displays the mean and standard deviations of these numbers using the following formula:
Here is a sample run:
Step by Step Answer:
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang