Question: LANGUAGE IS JAVA NEED OUTPUT TO LOOK LIKE EXPECTED OUTPUT AND NEED OUTPUT DISPLAYED ON A COMPILER NOT JUST CODE Write a Java class PatternedArray.java


LANGUAGE IS JAVA NEED OUTPUT TO LOOK LIKE "EXPECTED OUTPUT" AND NEED OUTPUT DISPLAYED ON A COMPILER NOT JUST CODE
Write a Java class PatternedArray.java that will create an 2-dimensional array and print it in a table format. The program should Create a two-dimensional array and that is filled with whole numbers such that the elements have the following pattern: . Row 1:10+numRows*1+ 0, 10+numRows 1+1,10+numRows 1+2,.. Row 2: 10+numRows*2+ 0, 10+numRows*2+1, 10+numRows*2+2,... Row 3: 10+numRows 3+ 0, 10+numRows*2+1, 10+numRows 3+2, Print the array by row where each element printed has a minimum width of 4 spaces and is left-justified. Use System.out.printf (). [Note: printf() is identical to format( End each row with a newline and complete the output with a blank line. See ZyBooks Chapter 8.3 for printf () explanation. Sample output where input is 3 5 13 14 15 16 17 16 17 18 19 20 19 20 21 22 23 Sample output where input is 1 4 11 12 13 14 Sample output where input is 5 3 15 16 17 20 21 22 25 26 27 30 31 32 35 36 37 Hint: array[0][0]); would print the value at array [0][0] with a minimum width of three spaces right system . out .printf ("%3d", justified. would print the value at array[3 with a If row is 3 and col is 0, System.out.printf("8-8d", array[row][col] minimum width of eight spaces left-justified
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
