Question: Home Exercise : Write a java program to do the following: a. Declare a 2D- array named mat of type double and size 2 X

 Home Exercise : Write a java program to do the following:

Home Exercise : Write a java program to do the following: a. Declare a 2D- array named mat of type double and size 2 X 3 and b. Prompt the user to input the array elements from keyboard. c. Call the following methods : 1. Method AVG to find and return the average of the array. 2. Method SumRow to calculate and display the sum of each rows. 3. Method ADD to ask the user to input a double number n and add it to each element in the array, Sample output: Output - Array (run) * run: DD Enter the array elements: ROW 0: 10 20 30 ROW 1: 40 50 60 The average of the array elements: 210.0 The sum of row 0 : 60 The sum of row 1 : 150 Enter a number n to add it to the array: 5 The array elements after adding 5.0to each element: 15.0 25.0 35.0 45.0 55.0 65.0 BUILD SUCCESSFUL (total time: 18 seconds) 2

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!