Question: New Question: What does it take to send values through these array methods and receive the output? We are supposed to get the largest and

New Question: What does it take to send values through these array methods and receive the output? We are supposed to get the largest and smallest values using the double and int array methods. Can anyone please explain how? ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Initial Requirements: Write methods using the following headers that returns the location of the largest element in the array passed to the method returning a one-dimensional array that contains two location elements.

1. public static int [] locateLargest (double [][] arrayParam)

2. public static int [] locateLargest (int [][] arrayParam)

Then, write methods using the following headers that returns the location of the smallest element in the array passed to the method returning a one-dimensional array that contains two location elements.

public static int [] locateSmallest (double [][] arrayParam)

2. public static int [] locateSmallest (int [][] arrayParam)

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

// Code I have so far: public static int [] locateLargest (double [][] arrayParam) { int arrRes[]=new int[2]; double res=arrayParam[0][0]; for(int i=0;ires) { res=arrayParam[i][j]; arrRes[0]=i; arrRes[1]=j; } } } return arrRes; } public static int [] locateLargest (int [][] arrayParam) { int arrRes[]=new int[2]; int res=arrayParam[0][0]; for(int i=0;ires) { res=arrayParam[i][j]; arrRes[0]=i; arrRes[1]=j; } } } return arrRes; }

public static int [] locateSmallest (double [][] arrayParam) { int arrRes[]=new int[2]; double res=arrayParam[0][0]; for(int i=0;i

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!