Question: create a new Java application called AverageWithArrays (without the quotation marks) according to the following guidelines. (This program requires the use of arrays.) The program

create a new Java application called "AverageWithArrays" (without the quotation marks) according to the following guidelines. (This program requires the use of arrays.)

The program prompts the user for five to ten doubles, all on one line, each separated by a space, calculates the average of those doubles, and displays the doubles and their average to the user.

The program uses methods to:

Get the doubles entered by the user

Calculate the average of the doubles entered by the user

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

...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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!