Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use Java Ecplise. (2D array + method) Write a Java program to meet the following requirements: 1. In your main method, you should Declare a
Use Java Ecplise.
(2D array + method) Write a Java program to meet the following requirements: 1. In your main method, you should Declare a 2-Dragged array with the values as below. int[][] matrix = {{11},{20,30}, {40,50,60}}; Invoke three methods below which will print out all array elements and the sum, average of all array elements. (Do not hardcode the output/return value of the method, the output/return value should depend on the method's input parameter). 2. Write a method that will take an integer 2-D array as the input and print each element of the input 2-D array. The numbers should be aligned as below. Array 11 20 30 40 50 60 3. Write a sum method that will take an integer 2-D array as the input and return the sum of all array elements. example output: 4. Write an avg method that will take an integer 2-D array as the input and return the average (date type: double) of all array elements. 5. The following output is an example of your final output: Array 11 20 30 40 50 60 Sum: 211 Average: 35.17 6. This Program assignment does not take any input from the keyboardStep 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