Question
Problem 2: Write a Java class called ArrayTwoDim.java which calculates the sum of rows and columns of a 2D array (Matrix) and displays the 2D
Problem 2:
Write a Java class called ArrayTwoDim.java which calculates the sum of rows and columns of a 2D array (Matrix) and displays the 2D array.
The 2D array is already provided in Java class ArrayTwoDimTest.java , use this class to test the ArrayTwoDim.java.
Submit only the ArrayTwoDim.java file. We will use our own ArrayTwoDimTest to test your ArrayTwoDim class when grading your submission.
Input 2D array:
20 15 6 19 18
4 46 24 17 18
12 50 23 16 31
Sample Output:
The sum of row 1 = 78
The sum of row 2 = 109
The sum of row 3 = 132
The sum of column 1 = 36
The sum of column 2 = 111
The sum of column 3 = 53
The sum of column 4 = 52
The sum of column 5 = 67
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