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
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