Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. Write a program that creates a two-dimensional array initialized with input integers. The program should have the following static methods: getTotal -- This method

image text in transcribedimage text in transcribed

. Write a program that creates a two-dimensional array initialized with input integers. The program should have the following static methods: getTotal -- This method should accept a two-dimensional array as its argument and return the total of all the values in the array. getAverage -- This method should accept a two-dimensional array as its argument and return the average of all the values in the array. getMax -- This method should accept a two-dimensional array as its argument and return the highest value in the array. getMin -- This method should accept a two-dimensional array as its argument and return the highest value in the array. getRowTotal -- This method should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The method should return the total of the values in the specific row. getColumn Total -- This method should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a column in the array. The method should return the total of the values in the specific column. . . In the main method, ask the user to enter number of rows and columns for the 2-D array, populate the array with input integers from the user, and then call each of the methods above and display output. Check the sample output on next page (leave 2 decimal places for the average value, you need to use printf instead of println). Sample Output Enter number of rows for the 2-D array: 3 Enter number of columns for the 2-D array: 4 Enter integers for the 3 by 4 array: 1 4 5 6 8 9 7 2 2 0 1 8 The sum of the array is: 53 The average of the array is: 4.42 Max value of the array is: 9 Min value of the array is: 0 The total for row 0 is 16 The total for row 1 is 26 The total for row 2 is 11 The total for column is 11 The total for column 1 is 13 The total for column 2 is 13 The total for column 3 is 16

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_2

Step: 3

blur-text-image_3

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

OUTCOME 4 Explain how labour relations differ around the world.

Answered: 1 week ago

Question

LO3 Name the seven categories of HR functions.

Answered: 1 week ago