How to write a program called StatisticsCalculator that calculates the mean (average) and standard deviation for a set of integer values entered by the user. Your program should
Prompt the user for the number of values, n. (n must be 1 or greater!) Output “You must enter an integer greater than 0” and reprompt the user if the number of values is not an integer value greater than 0.
How to create an array to store the values.
Prompt the user for each value and store it in the array. Output “Invalid value” and reprompt if the user enters something other than an integer.
Calculate and output the mean of the values with 2 decimal places.
Calculate and output the standard deviation of the values (with 2 decimal places) using the formula given below:
Here are some examples of program execution:
% java StatisticsCalculator
How many values?: 4
Enter value 1: 4
Enter value 2: 5
Enter value 3: 8
Enter value 4: 9
Mean: 6.50
Standard Deviation: 2.06
$ java StatisticsCalculator
How many values?: 0
You must enter an integer greater than 0
How many values?: abc
You must enter an integer greater than 0
How many values?: 3
Enter value 1: 8
Enter value 2: xyz
Invalid value
Enter value 2: hi
Invalid value
Enter value 2: 9
Enter value 3: 2.25
Invalid value
Enter value 3: 2
Mean: 6.33
Standard Deviation: 3.09