/** * * The program has a two dimensional array of numbers. What I need * is to
ID: 3642361 • Letter: #
Question
/***
* The program has a two dimensional array of numbers. What I need
* is to "search" the array and find all elements that are MAX.
* This is to be accomplished with at least 2 methods in addition to the
* main method.
* Method 1 needs to search the array and return the largest number in the array (MAX).
* Method 2 needs to print out the [row][column] of each element that equals MAX.
*
*/
public class FindTheLargest {
public static void main(String[] args)
{
//Initialization and Declarations
int numberArray[][] = {{0,3,4,0,0,0,6,8},
{5,13,6,0,0,0,2,3},
{2,6,2,7,3,0,15,0},
{0,0,4,15,4,1,6,0},
{0,0,7,12,6,9,10,4},
{5,0,6,10,6,4,15,0}};
}//end of main
}//end of Class
Explanation / Answer
please rate. public class FindTheLargest { /** * Gets the maximum number in array. * * @param array the array * @return the max */ public static int getMax(int array[][]){ int max = 0; for(int i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.