Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program in java netbeans that will read numbers from the keyboard into a

ID: 3741289 • Letter: W

Question

Write a program in java netbeans that will read numbers from the keyboard into a 2-dimensional table. Calculate totals for the rows, the columns, and a grand total. Then print the table and the totals on the screen.

The main method should do the following:

• create the arrays for the table (3 x 5), the row totals (3 elements), the column totals (5 elements),

• define other variables needed, such as the grand total,

• Call a method that will fill the table.

This method will prompt the user with the row number and column number for the value to be entered. The value entered by the user will be stored in the table,

• calculate values for the row totals and the column totals and store them in these 2 arrays,

• calculate and return the grand total for the table,

• call a method that will o Print the table and the row totals. Each line printed should have the numbers from a row of the table and the corresponding row total o Print a blank line. o Print the column totals and the grand total on a line.

Explanation / Answer

import java.util.Scanner; public class MatrixRowColSum { public static int[][] fillArray(int[][] mat) { Scanner scan = new Scanner(System.in); for (int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote