Question
Please do not copy and paste the same incorrect answer that has been given to this question multiple times Complete a C++ console program Display
Please do not copy and paste the same incorrect answer that has been given to this question multiple times
Complete a C++ console program
-
Display a 7x7 grid on screen like the one shown on slide #1.
-
The 1 must be randomly placed within its inner 5x5 grid.
-
The surrounding numbers 2 ~ 25 are visible to user immediately.
-
The solution must be hidden but can be shown by request with a passcode COP3331.
-
-
User can enter a 4-digit value to place a number onto a cell. For instance, 0715 means placing 7 to the cell at the first row (row 1) and last column (column 5), and 2134 means placing 21 to the cell at the middle row (row 3) and the 2nd column from the right (column 4).
-
User can enter 0000 to reset or undo the number placed previously and this can be repeated more than once.
-
Invalid input with incorrect number or row/column that violates the rules results an error message and allows to re-enter.
-
Using classes and objects is NOT required, i.e., it can be a non-OO program, but the main() should contain as few statements as possible.
-
All code are saved in one file named 5x5puzzle.cpp.
Goal: fill numbers of 2 to 25 into the cells while the following two rules are satisfied.
-
Consecutive numbers must be adjacent, either horizontally, vertically, or diagonally.
-
All numbers must be placed in the corresponding row, column, or diagonal in which they appear around the border of the grid.
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