Question: create a new Java application called Scorer (without the quotation marks) that declares a two-dimensional array of doubles (call it scores) with three rows and

create a new Java application called "Scorer" (without the quotation marks) that declares a two-dimensional array of doubles (call it scores) with three rows and three columns and that uses methods and loops as follows.

Use a method containing a nested while loop to get the nine (3 x 3) doubles from the user at the command line.

Use a method containing a nested for loop to compute the average of the doubles in each row.

Use a method to output these three row averages to the command line.

Note

The requirement is to use a two-dimensional array of type double called scores with 3 rows and 3 columns.

Two methods are required.

The first method prompts the user to enter 9 values and then stores them in the scores array. Using a nested loop (for or while) is required. As long as you use a nested loop of some type, thats fine.

The second method calculates the row averages. My approach was to store the row averages in a separate 3-element array (declared in main and passed into the method as a parameter along with the scores array). Use a nested for loop for processing the rows and calculating the row averages.

The third method takes the 3-element array containing the row averages and uses a for loop to display each of the average values.

Here is an example run:

run:

Enter 9 numbers

Value 1: 10

Value 2: 20

Value 3: 30

Value 4: 40

Value 5: 50

Value 6: 60

Value 7: 70

Value 8: 80

Value 9: 90

The average of row 1 is 20.00

The average of row 2 is 50.00

The average of row 3 is 80.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!