Question: Assignment Lo Shu Magic Square The Lo Shu Magic Square is a grid with 3 rows and 3 Columns shown in the figure 4 9
Assignment
Lo Shu Magic Square
The Lo Shu Magic Square is a grid with 3 rows and 3 Columns shown in the figure
| 4 | 9 | 2 |
| 3 | 5 | 7 |
| 8 | 1 | 6 |
The Lo Shu Magic Square has the following porperties.
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. This is show in the figure below.
| 4 | 9 | 2 |
| 3 | 5 | 7 |
| 8 | 1 | 6 |
The sum is 15 for all.
Write a program in C++, that you can simulate a magic square using a two- dimensional array. Write a function taht accept a two dimensional array as an argument, and determines whether the array is a Lo Shu Magic Square. Test the function in the Program. Please include the Pseudocode also for the entire program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
