Question: java coding help 1. Given the following 2D array: String[ ][ ] months=new String[x][y]; Write a line of code that will output the # of

java coding help

1.

Given the following 2D array: String[ ][ ] months=new String[x][y];

Write a line of code that will output the # of columns in the array.

2.

Given the following 2D array: double[ ][ ] values=new double[x][y];

Write a line of code that will output the # of rows in the array.

3.

What does the following mysteryMethod do? public int mysteryMethod() { int total = 0; for (int row = 0; row < matrix.length; row++) { for (int col = 0; col < matrix[0].length; col++) { total = total + matrix[row][col]; } } return total; }

4.

2D Array of Temperatures: int[ ][ ] temps=new int[x][y];

Method Heading: public int[ ] calculateRowSums(int[ ][ ] temps)

Write a method to calculate the sum of each row in the 2D array. The method must work for any size array.

5.

2D Array of Temperatures: int[ ][ ] temps=new int[x][y];

Method Heading: public int findMinTemp(int[ ][ ] temps)

Write a method to find the minimum temperature in the array. The method must work for any size array.

6.

Given: 2D Array of Numbers: int[ ][ ] numbers=new int[x][y];

Method Heading: public int countValue(int[ ][ ] numbers, int value)

Write a method to count the # of times "value" appears in the array.

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!