Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Using Microsoft Visual Studio, write a c++ program that includes a class called Sudoku for generating and solving Sudoku puzzles. The class should contain the

Using Microsoft Visual Studio, write a c++ program that includes a class called Sudoku for generating and solving Sudoku puzzles. The class should contain the following public member functions:

-Sudoku::Sudoku(int n)Populates n squares of the 9x9 matrix with legal values

-int Sudoku::solve() Produces a valid solution to the generated puzzle (returns 1 on success, 0 on failure)

-void Sudoku::printGrid() Prints the 9 x 9 grid

The program should begin by asking for an initial number of squares to randomly (and legally) populate. The initialized grid should then be printed, using * for undetermined values. The

program then tries to find a solution.If a valid solution is found, the solution is then printed to the screen. Otherwise, the messageSorry, unsolvable is printed.

Submit a .zip file to Canvas that contains three files: main.cpp, sudoku.cpp, and sudoku.h.

I would appreciate any help, refer to the image below.

Thank you!

image text in transcribed

sudoku elcone to SudokuSolver1 nter number of squares to prepopu late: 10 olvedl 3 6 81 571249 5 7 92 16 1 3 2 3 16 518 9 7 4 8 5137 911 2 6 79 68 1 2 14 35 6 5 21731984 8 4 319 2617 5 1 9 1715481362 PhillipsODESKTOP-57MNRES /cygdrive/f/Documents/ECE 1410/Homework/sudoku sudoku elcone to SudokuSolver1 nter number of squares to prepopu late: 10 olvedl 3 6 81 571249 5 7 92 16 1 3 2 3 16 518 9 7 4 8 5137 911 2 6 79 68 1 2 14 35 6 5 21731984 8 4 319 2617 5 1 9 1715481362 PhillipsODESKTOP-57MNRES /cygdrive/f/Documents/ECE 1410/Homework/sudoku

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions