Question: In this assignment you are to develop a program that will (in the main method) accept an int (0 - 9 inclusive), trapping the user

In this assignment you are to develop a program that will (in the main method) accept an int (0 - 9 inclusive), trapping the user if they enter an invalid value, save the value entered as size.

You are to then develop a method that will accept the value stored in size and print a size x size array of random numbers 1 - size * size with no repeats.

Call the method above from within the main method.

Samples of the input/output are:

----jGRASP exec: java GenerateSudoku_Size Please enter a positive int, 0 - 9 3 9 1 2 4 6 7 5 3 8 ----jGRASP: operation complete.

----jGRASP exec: java GenerateSudoku_Size Please enter a positive int, 0 - 9 3 6 8 1 9 7 2 4 5 3 ----jGRASP: operation complete

----jGRASP exec: java GenerateSudoku_Size Please enter a positive int, 0 - 9 10 Please enter a positive int, 0 - 9 -1 Please enter a positive int, 0 - 9 4 11 15 16 1 6 5 7 3 13 2 12 14 10 9 4 8 ----jGRASP: operation complete.

Name the program arrayRandom2D_yourInitials.java. Where yourInitials represents your initials.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!