Question: a) Create a method named printMatrix(). This method accepts a 2D array of integers and prints it in a structured table format. b) Construct a

a) Create a method named printMatrix(). This method accepts a 2D array of integers and prints
it in a structured table format.
b) Construct a method named findStats(). This method should process a 2D array of integers
and determine both the maximum and minimum values contained within it. The method
should return these two values.
c) Generate a 2D array of integers (the size is at your discretion) filled with random numbers
and apply your methods to this array.
2. Write the following program: Create multiple versions of a method, countEven(), to count the
even numbers from different types of input.
a) Method 1 accepts three integers as parameters and prints the count of even numbers to
the console.
b) Method 2 accepts a 1D array of integers and prints the count of even numbers to the
console.
c) Method 3 accepts a 2D array of integers and returns the count of even numbers to the
caller.
d) Validate each countEven() method with the provided test cases:
countEven(5, 7, 10);
countEven(8, 2, 7);
countEven(new int[]{5, 7, 3, 9, 0});
countEven(new int[]{2, 6, 4, 8, 1});
countEven(new int[][]{{1, 2}, {3, 4, 5}});
countEven(new int[][]{{6, 2}, {3, 4, 0}});

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solution a Create a method named printMatrix This method accepts a 2D array of integers and prints i... View full answer

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 Programming Questions!