Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective You will create a simple Sudoku puzzle game that has the following functionalities Presents the puzzle to the user and asks to continue or

image text in transcribed
image text in transcribed
Objective You will create a simple Sudoku puzzle game that has the following functionalities Presents the puzzle to the user and asks to continue or not. The puzzle will have '0' in place where user needs to enter values to solve the puzzle. Initially, the following puzzle wll be presented in the following format: 5 3 41078191 2 6 7011953 48 1 983421507 8 09176114 2 3 4 261803179 0 71319241856 9011537128 4 2 871419160 5 3 45 2861179 Continue Playing (YIN)?" If user enters "N", it ends the program. If user enters anything other than Y or "N", program says "Invalid Input" and asks "Continue Playing (Y/N)?" 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 row/column 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 row/column 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 (Y/N)? question. o If user enters a wrong rowlcolumn combination (row/column that is not "0"), displays the message Wrong Entry", displays the current puzzle and then displays the "Continue Playing (Y/N)?" question. o If user enters a valid row/column/value, it checks if the entry is correct or not based on Sudoku rules. (Fill to fill a 9x9 grid with digits so that each column, each row, and each of the nine 3x3 subgrids that compose the grid contain all of the digits from 1 to 9) If entry is not correct, displays "NOT Correct!, displays the Sudoku puzzle again and then asks Continue Playing (Y/N)?" If entry is correct, displays "Correct!", displays the Sudoku puzzle again and then asks Continue Playing (Y/N)?" After every "correct' entry, program also checks if every piece of the puzzle was solved (no "O's left). If no "O"s left, it displays "Congratulations, You solved it!" 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 9 isRowColumnValid: Checks if user entered row, column is between the limits and if entered row/column value is "O" isEntryCorrect: Checks if user entered row, column, value is correct based on Sudoku rules The puzzle is solved and the program should end when the following status is reached 5 3 46781912 6 721 1951348 198342156 7 8597611423 42618531791 71319241856 9615371284 2871419163 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

Discuss how selfesteem is developed.

Answered: 1 week ago

Question

Define Management by exception

Answered: 1 week ago

Question

Explain the importance of staffing in business organisations

Answered: 1 week ago

Question

What are the types of forms of communication ?

Answered: 1 week ago

Question

Explain the process of MBO

Answered: 1 week ago

Question

2. Identify issues/causes for the apparent conflict.

Answered: 1 week ago