Question: //////////JAVA CODING PROBLEM////////// Two-Dimensional Array. Using JAVA, Complete the given class by writing a method that: a. takes in any two-dimensional array of integers, b.
//////////JAVA CODING PROBLEM//////////
Two-Dimensional Array. Using JAVA, Complete the given class by writing a method that:
a. takes in any two-dimensional array of integers,
b. returns the sum total of all integers in the array
c. prints the array values by row with a sub-total at the end of each row
d. code must generate this Example Output:
Values in array1 by row are:
1 2 3 = 6
6 5 = 11
8 = 8
Array-Total = 25
//// your class starts here///
public class ArrayQuickCode
{
// create and output two-dimensional arrays
public static void main( String[] args )
{
int[][] array1 = { { 1, 2, 3 }, { 6, 5 }, { 8 } };
System.out.println( " Values in array1 by row are: " );
int arrayTotal = outputArray( array1 );
System.out.printf("Array-total = %d ", arrayTotal);
} // end main
// Write your method here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
