Lo Shu Magic Square

I need help with the class definition and methods at the end

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <fstream>

using namespace std;

//Place the class definition after this line




int main()
{
//Create a LoShuMagicSquare object that will be used to test the 4 puzzles
LoShuMagicSquare puzzle;


//Puzzle 1 using loshu_puzzle1.txt. The object will be filled, displayed,
//and then tested to see if it is a valid solution

cout << "Puzzle 1:" << endl << endl;
puzzle.fillSquare( "loshu_puzzle1.txt");

puzzle.printSquare();

cout << endl << "Is it magic? " << ( puzzle.isMagic() ? "Yes": "No" ) << endl << endl << endl;


//Puzzle 2 using loshu_puzzle2.txt. The object will be filled, displayed,
//and then tested to see if it is a valid solution
cout << "Puzzle 2:" << endl << endl;

puzzle.fillSquare( "loshu_puzzle2.txt");

puzzle.printSquare();

cout << endl << "Is it magic? " << ( puzzle.isMagic() ? "Yes": "No" ) << endl << endl << endl;


//Puzzle 3 using loshu_puzzle3.txt. The object will be filled, displayed,
//and then tested to see if it is a valid solution
cout << "Puzzle 3:" << endl << endl;

puzzle.fillSquare( "loshu_puzzle3.txt");

puzzle.printSquare();

cout << endl << "Is it magic? " << ( puzzle.isMagic() ? "Yes": "No" ) << endl << endl << endl;


//Puzzle 4 using loshu_puzzle4.txt. The object will be filled, displayed,
//and then tested to see if it is a valid solution
cout << "Puzzle 4:" << endl << endl;

puzzle.fillSquare( "loshu_puzzle4.txt");

puzzle.printSquare();

cout << endl << "Is it magic? " << ( puzzle.isMagic() ? "Yes": "No" ) << endl << endl << endl;


return 0;
}

//Code the methods below this line
Topic archived. No new replies allowed.