help me solve this in c++ please Write a program that asks the user to enter a list of numbers from 1 to 9 in random order, creates and displays the corresponding 3 by 3 square, and determines whether the resulting square is a Lo Shu Magic Square. Notes Create the square by filling the numbers entered from left to right, top to bottom. Input validation - Do not accept numbers outside the range. Do not accept repeats.
help me solve this in c++ please Write a program that asks the user to enter a list of numbers from 1 to 9 in random order, creates and displays the corresponding 3 by 3 square, and determines whether the resulting square is a Lo Shu Magic Square. Notes Create the square by filling the numbers entered from left to right, top to bottom. Input validation - Do not accept numbers outside the range. Do not accept repeats.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
help me solve this in c++ please
Write a program that asks the user to enter a list of numbers from 1 to 9 in random order, creates and displays the corresponding 3 by 3 square, and determines whether the resulting square is a Lo Shu Magic Square.
Notes
- Create the square by filling the numbers entered from left to right, top to bottom.
- Input validation - Do not accept numbers outside the range. Do not accept repeats.
- Must use two-dimensional arrays in the implementation.
- Functional decomposition — Program should rely on functions that are consistent with the
algorithm .

Transcribed Image Text:Lo-Shu Magic Square
loShu.cpp
The Lo Shu Magic Square is a grid with 3 rows and 3 columns as shown below:
492
357
816
The grid contains the numbers 1 through 9 exactly.
The sum of each row, each column, and each diagonal all add up to the same number:
15
492 15
357 15
8 16 15
15
15 15 15

Transcribed Image Text:Input Validation
Microsoft Visual Studio Debug Console
Lo Shu Magic Square
Creating Lo Shu Square
Enter Nine Numbers (1-9)
Number 1: 1
Number 2: 2
Number 3: 2
Error ...
2 is already in the Lo Shu Square. Try again
Number 3: 3
Number 4: 4
Number 5: 5
Number 6: 10
Error ... Invalid number. Try again
Number 6: 6
Number 7: 7
Number 8: 8
Number 9: 9
|| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 9 |
Sorry ... this is not a Lo Shu Magic Square
Would you like to try again (y/n)? n
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education