Skip to main content

9.8) Exercise 17


Copy your solution to Exercise 11 to a new file. Add to this new program some code that will compute and display the arithmetic mean and the standard deviation of the values in your vector.

Use the accumulate algorithm to help you compute the mean.

You can compute standard deviation using a for loop that computes the deviation of each value from the mean, squares this deviation and then sums the squared deviations. You will also need to use the sqrt function. Remember that #include <cmath> is needed in order to use sqrt.