Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  1. 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.

  2. 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).

  3. User can enter 0000 to reset or undo the number placed previously and this can be repeated more than once.

  4. Invalid input with incorrect number or row/column that violates the rules results an error message and allows to re-enter.

  5. 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.

  6. All code are saved in one file named 5x5puzzle.cpp.

image text in transcribed

Goal: fill numbers of 2 to 25 into the cells while the following two rules are satisfied.

  1. Consecutive numbers must be adjacent, either horizontally, vertically, or diagonally.

  2. All numbers must be placed in the corresponding row, column, or diagonal in which they appear around the border of the grid.

9 5 19 15 14 12 2 312 13 4 8 9- 10 14 10 22 2019 15 17 18 18 16 24 23 21 20 25 3 16 9 5 19 15 14 12 2 312 13 4 8 9- 10 14 10 22 2019 15 17 18 18 16 24 23 21 20 25 3 16

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

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

Recommended Textbook for

Optimizing Data Collection In Warzones

Authors: Aaget Aamber

1st Edition

B0CQRRFP5F, 979-8869065902

More Books

Students also viewed these Databases questions

Question

Technology. Refer to Case

Answered: 1 week ago