Question
Requirements :----- Write a complete Java program called Scorer that declares a two-dimensional array of doubles (call it scores) with three rows and three columns
Requirements :-----
Write a complete Java program called Scorer 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.
output looks like this:
partial code---- **Need Help finishing it**
public class Scorer {
public static void main(String[] args) { // TODO code application logic here final int MAX_SIZE = 3; double [][] scores = new double [MAX_SIZE][MAX_SIZE]; scores = getNumbersFromUser(MAX_SIZE); double[] rowAverages = computeRowAverages(scores, MAX_SIZE); printRowAverages(scores, rowAverages); } public static double [][] getNumbersFromUser(int size) { double [][] numbers = new double [size][size]; Scanner in = new Scanner(System.in); System.out.println("Enter a line of 9 numbers, each followed by a space; enter 'q' to end data entry: "); for (int i = 0; i Enter line of 3 numbers, each Fomowed by a space; enter to end data entry 1 2 3 4 5 6 7 B 9 q The average of the first row [1.0 2.0, 3.01 is 2.0 The average of the first row t4.0, 5.0 6.01 is 5.0. The average of the first row 17.0, B-0, 9.01 is B-0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started