Question: In C++ Part 1 - Initialize, Read In, and Print Sudoku Board (2D Array) (20 points) For part one you must allow the user to

In C++

In C++ Part 1 - Initialize, Read In, and Print Sudoku Board

Part 1 - Initialize, Read In, and Print Sudoku Board (2D Array) (20 points) For part one you must allow the user to enter a filename (ex file1.txt) of a given sudoku board. You must read this file in and store it in a 9x9 2D character array. After reading the file in, print the contents of the sudoku board out to the screen. Part 2- Determine if Rows and Columns are Valid (30 points) For part two you will need to determine and print out if all the rows are valid Sudoku rows (each row should have at most one instance of the number 1-9 and may contain any number of x's). You will also need to determine and print out if all the columns are valid Sudoku columns (same rule applies as with rows- at most one instance of the number 1-9 or any number of xs) 15 points Determine and print out rows validity 15 points- Determine and print out columns validity Part 3-Determine if all 3X3 Grids are Valid (30 points) For part three you will determine if all of the 3x3 grids within the sudoku board are valid. The same rule as with rows and columns apply -each 3x3 grid should have at most one instance of the numbers 1-9 and may contain any number of xs. Part 4 - Determine if the entire Sudoku Board is Valid (20 points) Based on the above sections, determine if the entire Sudoku board is 'valid or "invalid. This again doesn't mean it has to be solvable, only valid or invalid. Deductions Graded by TAs Follow the Style Guide as outlined on Canvas. Test Cases-Take the first example sudoku board given (that is valid) and change it so that each of the 3X3 grids is valid and at least one row and one column are invalid, thus the overall board will also be invalid. Take the first example sudoku board and change it so that only a row is invalid and the column and 3X3 grids are all valid. HINT - you can add xs even if there weren't any to begin with. Notes File names will be one word so you can use cin You are welcome to use functions, but are not required to. You can assume all the files you read in will have valid input in the correct format 9x9 grid (spaces between each character and a new line between each line) The input will be a filename provided by the user. An example of the input and output is as follows: Please enter a file name of a Sudoku grid to read in. Type quit to exit file1.txt 1 2 3 4 B9 5 3 5 7 1 6 S 4 8 2 4 9 8 2 75 3 1 6 5 3 1 6 8 7 9 2 4 7 8 4 9 1 2 5 3 9 2 5 3 4 1 7 8 2 1 3 7 5 8 4 S 6 4 5 8 9 1 2 3 7 8 79 4 2 3 E 5 1 All rows are valid. All columns are valid. All 3x3 grids are valid. Sudoku board is valid. Please enter a file name of a Sudoku grid to read in. Type quit to exit file2.txt 1 2 3 4 B 7 9 5 3 5 7 1 6 9 4 8 2 4 9 9 275 3 1 5 3 1 6 8 7 9 2 4 7B 4 9 1 2 56 3 9 E 2 5 3 4 178 2 1 3 7 5 6 8 4 S 6: 4 5 89 1 2 3 7 8 7 9 4 2 3 E 5 1 One or more rows are not valid. One or more columns are not valid. One or more 3x3 grids are not valid. Sudoku board is invalid Please enter a file name of a Sudoku grid to read in. Type quit to exit file3.txt 1 2 6 3 4 7 79 5 3 5 7 1 6 9 4 8 2 4 9 8 2 5 3 1 6 5 3 1 8 x 92 4 7 8 4 9 1 2 5 6 3 9 E 2 5 3 4 1 7 8 2 1 37 5 B 4 9 64 5 89 1 2 3 7 8 79 4 2 3 E 5 1 One or more rows are not valid. All columns are valid. All 3x3 grids are valid. Sudoku board is invalid

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!