Angie A.

asked • 05/04/20

Need help with ragged Array method I have been working on for project

getHighestInColumn

public static double getHighestInColumn(double[][] data,

int col)

Returns the largest element of the selected column in the two dimensional array index 0 refers to the first column. If a row in the

two dimensional array doesn't have this column index, it is not an error, it doesn't participate in this method.

Parameters:

data - the two dimensional array

col - the column index to find the largest element of (0 refers to the first column)

Returns:

the largest element of the column

my code:

}

public static double getHighestInColumn(double[][]data, int col) {

double max = data[0][col];

for(int i =0; i<data.length; i++) {

if(data[i][col]> max) {

max = data[i][col];

}

}

return max;


}








1 Expert Answer

By:

Patrick B. answered • 05/04/20

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.