Question: To the TwoDArray class in Section 2.6 of the lecture notes, add a method called sumCols() that sums the elements in each column and displays
To the TwoDArray class in Section 2.6 of the lecture notes, add a method called sumCols() that sums the elements in each column and displays the sum for each column. Add appropriate code in main() of the TwoDArrayApp class to execute the sumCols() method.
2.6 
1 2 3 /** * TwoDArray.java * / public class TwoDArray private int a[][]; private int nRows; public TwoDArray (int maxRows, int maxCols) // constructor a = new int [maxRows] (maxCols) ; nRows = 0; public void insert (int[] row) WWWNNNNNNNNNNPPPPPPPPPP on W NOOCs owocowanie w NPO a [nRows] = row; nRow3++; public void display ( ) for (int i = 0; i
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
