Question: package edu.wit.cs.comp1050; //TODO: document this class import java.util.Random; import java.util.Scanner; public class PA5a { /** * Fill... * * @param args */ public static void

package edu.wit.cs.comp1050;
//TODO: document this class
import java.util.Random;
import java.util.Scanner;
public class PA5a {
/**
* Fill...
*
* @param args
*/
public static void main(String[] args) {
// TODO: write your code here
// Hint: You can use Random() and int [][]
}
/**
* For a given row index, return its sum.
*
* @param matrix
* 2D integer array
* @param row
* index
* @return sum of elements at given row; MIN_VALUE if matrix is empty
*/
public static int sumRow(int matrix[][], int row) {
// TODO: write your code here
return 0;
}
/**
* For a given column index, return its sum.
*
* @param matrix
* 2D integer array
* @param col
* index
* @return sum of elements at given column; MIN_VALUE if matrix is empty
*/
public static int sumColumn(int matrix[][], int col) {
// TODO: write your code here
return 0;
}
/**
* Display matrix
*
* @param matrix
*/
public static void print2DMatrix(int[][] matrix) {
// TODO: write your code here
}
/**
* Find the row with the highest sum in a given matrix
*
* @param matrix
* @return index of max row if found; -1 otherwise
*/
public static int maxRow(int matrix[][]) {
// TODO: write your code here
// Utilize sumRow() to find the row with the largest sum and return its
// index.
return 0;
}
/**
* Find the column with the highest sum in a given matrix
*
* @param matrix
* @return index of column row if found; -1 otherwise
*/
public static int maxColumn(int matrix[][]) {
// TODO: write your code here
// Utilize sumColumn() to find the row with the largest sum and return
// its index.
return 0;
}
}
Problem a (PA5a.java)(50%) Write a program that randomly fills in 0-9 into ann x m matrix, prints the matrix (print2DMatrix), and finds the index of rows and columns with the largest sum. After printing the matrix, complete sumRow0 sumColumn0 methods and then utilize them to find the maxRow0 and maxColumn0. Expected results: Enter a seed: 1 Enter number of rows: 2 Enter number of columns:3 The array content is: 5 8 7 3 4 4 The index of the largest row: 0 The index of the largest column: 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
