Question: Write an error-free Java program to do the following things. Prompt the user to input a set of numbers. The numbers represent hourly wages so
Write an error-free Java program to do the following things.
Prompt the user to input a set of numbers. The numbers represent hourly wages so they will be between 7.25 (peon) and 50 (big boss). The user should be able to input up to 35 numbers but if the user enters 0 then the data input ceases. All of the data that the user enters should be stored in a single array. You do not need to check the input data to see if it is in the proper range assume the user will input correct data.
The program should calculate the average, the variance and the kurtosis of the numbers that were entered. The equation for the average is given in the book. The formula for the variance and the kurtosis (fourth centralized moment) is given by
Variance = SIGMA (xi-x(bar))^2/(n-1)
kurtosis = SIGMA ((xi-x(bar))^4/(n*var)^2) - 3
where xi are the individual numbers, n is the number of data points, var is the variance, and is the average of the sample. Kurtosis gives an indication of how peaked the data samples are relative to a normal (Gaussian) distribution.
The kurtosis must be calculated via a call to a method.
At the end, the program should repeat all of the numbers on one line and then print the average, variance, and kurtosis of the data sample.
MMMEnter a data value (0 to quit) M10.5 MMMEnter a data value (0 to quit) M48 MMMEnter a data value (0 to quit) M8.25 MMMEnter a data value (0 to quit) M8.50 MMMEnter a data value (0 to quit) M20 MMMEnter a data value (0 to quit) M0 MMMsize = 5 MMMThe data values are . . . MMM10.5 48.0 8.25 8.5 20.0 MMMThe average is 19.05 MMMThe variance is 285.0125 MMMThe kurtosis is -1.1934395407885128
Remember to put the usual header at the top of the program and to submit via Canvas.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
