Use C++ code and draw a flow chart. I only want the FLOWCHART, not the code.
Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type.
Each one of the arrays corresponds to a row of the magic square.
The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not.
Project Specifications
Input for this project:
- Values of the grid (row by row)
Output for this project:
- Whether or not the grid is a magic square
- Programmer’s full name
- Project number
- Project due date
Processing Requirements
Use the following template to start your project:
#include<iostream>
using namespace std;
// Global constants
const int ROWS = 3; // The number of rows in the array
const int COLS = 3; // The number of columns in the array
const int MIN = 1; // The value of the smallest number
const int MAX = 9; // The value of the largest number
// Function prototypes
bool isMagicSquare(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size);
bool checkRange(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size, int min, int max);
bool checkUnique(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size);
bool checkRowSum(int arrayrow1[], int arrayrow2[], int arrayrow3[], int size);
bool checkColSum(int arrayrow1[], int arrayrow2[], int arrayrow3[], int size);
bool checkDiagSum(int arrayrow1[], int arrayrow2[], int arrayrow3[], int size);
void fillArray(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size);
void showArray(int arrayrow1[], int arrayrow2[], int arrayrow3[], int size);
int main()
{
/* Define a Lo Shu Magic Square using 3 parallel arrays corresponding to each row of the grid */
int magicArrayRow1[COLS], magicArrayRow2[COLS], magicArrayRow3[COLS];
// Your code goes here
return 0;
}
// Function definitions go here
Create and use the following functions:
- void fillArray(int arrayrow1[], int arrayrow2[], int arrayrow3[], int size) - Accepts 3 int arrays and size as arguments, and fills the arrays out with values entered by the user. The first argument corresponds to the first row of the magic square, the second argument to the second row, and the third argument to the third row of the magic square
- void showArray(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size) - accepts 3 int arrays and size as arguments and displays their content.
Example:
1 3 5 (arrayRow1)
6 7 9 (arrayRow2)
8 2 4 (arrayRow3)
- bool isMagicSquare(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size) - accepts 3 int arrays and a size as arguments and returns true if all the requirements of a magic square are met. Otherwise, it returns false. The first argument corresponds to the first row of the magic square, the second argument to the second row, and the third argument to the third row of the magic square.
- bool checkRange(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size, int min, int max) - accepts 3 int arrays, a size, and a min and max value as arguments and returns true if the values in the arrays are within the specified range min and max. Otherwise, it returns false. The first argument corresponds to the first row of the magic square, the second argument to the second row, and the third argument to the third row of the magic square.
- bool checkUnique(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size) - accepts 3 int arrays and size as arguments, and returns true if the values in the arrays are unique (only one occurrence of numbers between 1-9). Otherwise, it returns false. The first argument corresponds to the first row of the magic square, the second argument to the second row, and the third argument to the third row of the magic square.
- bool checkRowSum(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size) - accepts 3 int arrays and size as arguments and returns true if the sum of the values in each of the rows are equal. Otherwise, it returns false. The first argument corresponds to the first row of the magic square, the second argument to the second row, and the third argument to the third row of the magic square.
- bool checkColSum(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size) - accepts 3 int arrays and size as arguments and returns true if the sum of the values in each of the columns are equal. Otherwise, it returns false. The first argument corresponds to the first row of the magic square, the second argument to the second row, and the third argument to the third row of the magic square.
- bool checkDiagSum(int arrayrow1[], int arrayrow2[], int arrayrow3[], int size) - accepts 3 int arrays and size as arguments and returns true if the sum of the values in each of the array's diagonals are equal. Otherwise, it returns false. The first argument corresponds to the first row of the magic square, the second argument to the second row, and the third argument to the third row of the magic square.
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 6 images
- can solve this question with the flowchart showing clearly with all the partsarrow_forwardDon't you dare give me AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.arrow_forwardI am creating a c++ snakes and ladders game (no visuals). I want the game to have up to 5 or 6 players. For the snakes/ladders I am going to create a function which needs the dice roll and adds it to the score which will then decide if the player has landed on a snake or a ladder, is there any way I can get all players scores to be stored in the “score” variable in the switch statements without using multiple switch statements? So I basically want a switch statement which can accommodate all 1-6 players . E.g p1 initially at 1 rolls a 4. So their new score is 1+4=5, then the switch function checks for a ladder or snake. Then player 2 who's initially a 2 rolls a 5, so their new score is 2+5=7 then THE SAME switch function checks for a snake or ladder... And so on for all other players.arrow_forward
- Use C++ Please do not copy and paste the same answer that is found on google. I have tried to get this to compile in visual studio and it always fails.arrow_forwardAssninment I can do the flow chart I just need helpfiguring out why my code will not run correctly there is for a Java . I can do the flow chart on my own . Design (with a Visio flowchart) and code Programming Challenge 11. Celsius to Fahrenheit Table on p.264. Develop a 'Test Plan' in Excel and verify that your program works as expected. Submit your design flowchart, CelsiusFahrenheit.java and Test Plan files using the link below. For this program, you cannot use jOptionPane. In order to receive full credit, be sure your program includes: Top of program comments (see Resources for a checklist), meaningful comments throughout the code, proper indents/spacing and meaningful variable names at the top of the main method and output which is well labeled. At this point in the semester, you should be submitting code that includes good form and documentation throughout. Reductions for not following the class standards be a minimum of 20% of the grade. An example of my…arrow_forwardYou are burning some music CDs for a party. You have arranged a list of songs in the order youwant to play them. However, you would like to maximize your use of space on the CD, whichholds 80 minutes of music. To do so, you want to figure out the total time for a group of songsand see how well they fit. Write a design and a C++ program to help you accomplish this task.The data are on file “songs.txt” (which is provided for you). The time is entered as seconds. Forexample, if a song takes 7 minutes and 42 seconds to play, the data entered for that song wouldbe 462.After all the data has been read, the application should print a message indicating the timeremaining on the CD. The output must be in the form of a table with columns and headingswritten on a file. For example: (see image) Note: the output converts the input from seconds to minutes and seconds. Use meaningfulvariable names, proper indentation, and appropriate comments. Thoroughly test the programusing your own data sets.Use…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education