Reference no: EM132197891
Write a complete Java program called CalcAvg according to the following guidelines. This program requires the use of arrays.
The program prompts the user for five to ten numbers all on one line, separated by spaces, calculates the average of those numbers, and displays the numbers and their average to the user.
The program uses methods to:
get the numbers entered by the user,
calculate the average of the numbers entered by the user, and
print the results.
The first method should take no arguments and return an array of doubles that the user entered.
The second method should take an array of doubles (the return value of the first method above) as its only argument and return a double (the average).
The third method should take an array of doubles and a (single) double value as arguments but have no return value.
For example, if the user input is:
40.00 60.00 20.00 80.00 100.00
Then the program should give as output:
The average of the numbers 40.00, 60.00, 20.00, 80.00, and 100.00 is 60.00.
This program uses arrays