Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions