Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java *** For the purposes of our exam*** A 2D array in which the length of the array is different from the length of the

java
image text in transcribed
*** For the purposes of our exam*** A 2D array in which the length of the array is different from the length of the individual arrays in the 2D array is a non- square array A 2D array in which the length of the array is same as the length of each individual array in the 2D array is a square array. This may be specified as 3 x 3,4 x 4 etc. A 2D array in which the length of the array is different from the length of the individual arrays and the individual arrays have different lengths is a ragged array. Utilizing the following method name and specifications, write the Java static method code that would perform the indicated operation in a single Java class. 1. METHOD NAME: sumEvenValues SPECIFICATION: Accepts a 2D integer array (may be a ragged array) and returns the sum of all the values in the array that are even. This method must utilize a switch statement to determine if a number is even. 2. METHOD NAME: countOddValues SPECIFICATION: Accepts a 2D integer array that must be a square array and returns the number of odd values in the array. If the array is not square a 0 is returned and 'Input is Not Square' is displayed to the console. 3. METHOD NAME: array Min Max SPECIFICATION: Accepts a 2D integer array and returns a 1D integer array containing the minimum and maximum values in the array 4. METHOD NAME: changeArrayDimensions SPECIFICATION: Accepts a 2D integer array and returns a 1D integer array containing all the values in the 2D integer array. 5. METHOD NAME: mainDiagonali SPECIFICATION: Accepts no parameters and returns a 2D integer square array(3 x 3) which contains 1's on the main diagonal of the array and O's everywhere else. You must use a for loop in this method. 6. METHOD NAME formattedra Oi e *

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

More Books

Students also viewed these Databases questions

Question

What went well in the mediation process?

Answered: 1 week ago

Question

What is the cost concept with an example?

Answered: 1 week ago