Question: Write a Java program which fill a 2D-array square array as per a given patterns 1 and 2 (figure 2) and display them. Your program
Write a Java program which fill a 2D-array square array as per a given patterns 1 and 2 (figure 2) and display them. 
Your program should proceed as follows:
Display a welcome message.
Prompt the user for an integer which is 3. If the number entered is
the user until they enter a number 3 (use a do/while). This number will determine the
size of the square array.
Fill the array as per pattern 1 and display it using printf to format the array.
Fill the same array as per pattern 2 and display it using printf to format the array.
Display a closing message.
1 2 3 5 10 6 7 8 9 14 15 11 12 13 18 19 20 16 17 19 18 17 16 22 23 24 25 21 24 25 Pattern 1 Pattern 2 (Some slots are shaded to help vou see the pattern. Figure 2-Illustrations of patterns Figures 3 and 4 are screen captures to illustrate the expected behavior of your program. Array Pattern many rows/columns do you want your array to have? (Must be at least 3): Pattern number 1: 12 11 10 9 8 7 13 14 15 16 17 18 24 23 22 21 20 19 25 26 27 28 29 30 36 35 34 33 32 31 Pattern number 2: 2 4 5 6 12 7 8 9 10 11 17 18 13 14 15 16 22 23 24 19 20 21 27 28 29 300 25 26 32 33 34 35 36 31 All done
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
