Question: ******* I need the code java ************ Locate the largest element Write a method that takes a two-dimensional array as an argument and returns the

**************I need the code java ************ Locate the largest element Write aI need the code java ************

Locate the largest element Write a method that takes a two-dimensional array as an argument and returns the location of the largest element in that array. If the largest element is not unique, return the location of the first occurrence nearest to the upper left. Be sure to search each row left to right in a top to bottom sequence. public static int[] locateLargest (double a) The return value is a one-dimensional array that contains two elements. These two elements indicate the row and column indices of the largest element in the two-dimensional array. Write a test program that prompts the user to enter the number of rows and columns of a two- dimensional array and then the values for the array. The program finds the largest element in the array, and displays the location of that element. Include a loop that allows the user to repeat the above steps as often as s(he) they wishes. Sample Input and Output: Programmer: Course: Lab#: Due date: Name of the programmer (your name) COSC 211, Winter 2022 1 1-20-2022 Enter the number of rows and columns of the array: 3 4 Enter 12 values for the array: 50.3 22 12 17 18 27 65 33 48 62 10 1.5 The location of the largest element is: (1, 2) Do it again, yes (or no)? Yes Enter the number of rows and columns of the array: 5 2 Enter 10 values for the array: 75 12.5 10.5 19 27 33 48 97.1 97.1 82.7 The location of the largest element is: (3, 1) Do it again, yes (or no)? no

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!