Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions