Answered step by step
Verified Expert Solution
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
. 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started