Develop a program that will create a magic square

profileaj-120
magicsquare.h

#ifndef MAGICSQUARE_H #define MAGICSQUARE_H //---------------------------------------------------------------------------- // Programmer: // Assingment: 1 // Program: Magic Square program (odd series) // Date: Jan. 20, 2021 // // Purpose: // This program reads from the keyboard the size of a square and the // user is asked to input all elements in the square. Then the program // checks to see if the square is magic or not. If it is, it prints a // message that this is a magic square. Else, it generates one. // //----------------------------------------------------------------------------- #include <iostream> #include <stdio.h> using namespace std; #define MAX_SIZE 10 class MagicSquare { public: MagicSquare(); // Default Constructor MagicSquare(int square_size); // Explict Constructor w/ size bool analise_square(); // Analise if all the sum of all row, // col, and diag are equal or not void is_magic(); // Function performs different // Operations depending on the result // of the previous function void generate_square(); // Generate a magic square void read_data(); // Reads data from keyboard void print_square(); // Print Square private: int magic[MAX_SIZE][MAX_SIZE]; // Array to store square int magic_constant; // Magic Constant. n(n^2 + 1)/2 int size; // Size of current square }; #endif // MAGICSQUARE_H