subject

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, that’s 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

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:00, richellemjordan
Draw the hierarchy chart and design the logic for a program that calculates service charges for hazel's housecleaning service. the program contains housekeeping, detail loop, and end-of-job modules. the main program declares any needed global variables and constants and calls the other modules. the housekeeping module displays a prompt for and accepts a customer's last name. while the user does not enter for the name, the detail loop accepts the number of bathrooms and the number of other rooms to be cleaned. the service charge is computed as $40 plus $15 for each bathroom and $10 for each of the other rooms. the detail loop also displays the service charge and then prompts the user for the next customer's name. the end-of-job module, which executes after the user enters the sentinel value for the name, displays a message that indicates the program is complete.
Answers: 2
image
Computers and Technology, 22.06.2019 21:30, Cheflulu5727
Write a function named printfloatrepresentation(float number) that will print the floating point representation of a number using the format given below. (sign bit) exponent in binary (assumed bit).significandfor example if the number passed an argument is 71 yourprogram should print (0) 10000101 (1).00011100000000000000000similarl y if the number passed to the function as argument is -71 the program should print (1) 10000101 (1).00011100000000000000000
Answers: 3
image
Computers and Technology, 24.06.2019 15:30, livagrace
Emma is using an artificial intelligence system, which contains information on botany, to identify a type of plant from an image. what type of ai is emma using?
Answers: 1
image
Computers and Technology, 25.06.2019 04:30, tjjjjjjjjjjjjjjjjjjj
If you have watched pretty little liars(pll)what are the names of the main characters? all of them and the boyfriends and girlfriends too.
Answers: 2
You know the right answer?
Create a new Java application called "Scorer" (without the quotation marks) that declares a two-dime...

Questions in other subjects:

Konu
Mathematics, 15.12.2020 09:00
Konu
Mathematics, 15.12.2020 09:00