Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objective You will create a simple Sudoku game that has the following functionalities * Presents the puzzle to the user and asks to continue or
Objective You will create a simple Sudoku game that has the following functionalities * Presents the puzzle to the user and asks to continue or not. The puzzle will have in place where user needs to enter values to solve the puzzle. Initially, the following puzzle will be presented in the following format 5 3 41078191 2 67011951348 1981342150 80917611423 42618031790 7 1392418 56 905371284 2871 4191605 3 45 2861179 Continue Playing (Y/N)?" lf user enters "N. it ends the program If user enters anything other than "Y or N", program says "Invalid Input" and asks Continue Playing (YIN)?" again. . If user enters "Y".asks for the row, column and value for that row/column of the puzzle. For example: Enter row Enter column: Enter value: Program evaluates the entries as follows: o If user enters an invalid rowcolumn combination, (a number that is less 1 and more than 9), displays the message "Invalid row column" and displays the Continue Playing (Y/N)?" question. o If user enters a valid rowloolumn combination but an invalid number, (a number that is not between 1 and 9), displays the message Invalid value and goes back to the "Continue Playing (YIN question lf user enters a wrong rowicolumn oombination (rowicolumn that is not "O'. displays the message "Wrong Entry, displays the current puzzle and then displays the "Continue Playing (YIN)?" question. If user enters a valid rowcolumn/value, it checks if the entry is correct or not based on Sudoku rules. o o -If entry is not correct, displays 'NOT Correct, displays the Sudoku puzzle again and then asks "Continue Playing (YIN)? lf entry is correct. displays "Correct!"-displays the Sudoku puzzle again and then asks "Continue Playing (YIN)?" . After every 'correct entry, program also checks if every piece of the puzzle was solved (no "0's left). If no "Os left, it displays Congratulations, You solved itl message and ends the program Your project should have the name YourLastName Sudoku Your program should have two classes: Sudoku and Driver . Driver class will have the main method which create an object of the Sudoku class and initializes the values of the sudoku array based on the sudoku example above. Then it starts interacting with the user as described above. Sudoku will have all the checks and computations for the program. It will at least have the following methods: display: Displays current values of the puzzle isSolved: Checks if puzzle was solved or not isValueValid: Is entered value is numeric and between 1 to isRowColumnValid: Checks if user entered row, column is between the . limits and if entered rowicolumn value is O . isEntryCorrect: Checks if user entered row, column, value is correct based on Sudcku rules The puzzle is solved and the program should end when the following status is reached 5 31678191 2 6721 1951348 1981342156 8597611423 4 268531791 7139241856 96115371284 2 871419163 5 3 45 2861179
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