Question: 1. Declare a 2-D array with double[][] m={{10,20,0},{20,40,0}}; 2. Write a method computeAvg that will take a double 2-D array as the input, compute the
1. Declare a 2-D array with
double[][] m={{10,20,0},{20,40,0}};
2. Write a method computeAvg that will take a double 2-D array as the input, compute the average
of 1st and 2nd columns and put the average result at the 3rd column for each row.
3. Write a method printArray to print the values of the 2-D array. The numbers should be aligned.
4. In your main method, call computeAvg first, then call printArray
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
