Magic Square Tester

Hello there the class i am taking requires this program however it is very confusing and i cannot pick up on how this all works. I have been trying to make a magic square tester which prompt the user for the integers to fill a 3 x 3 two dimensional array. Once the data is entered the program checks to see if the
table forms a magic square. When complete have the program prompt the user to see if they want to
test another square and loop back accordingly. Note: Your solution should validate the input to the
program from erroneous input. This means that your program check to see that the data entered must
be between 1 and 9 inclusive and not duplicate data can be entered. Hint: A one dimensional array
could be used to keep a tally of which numbers have been assigned to the magic square.
Program Style:
The program must contain the following functions that carry out the operations in the given

main: This function explains the magic square directions, organizes calls to
other functions, and reports final result.
getData: This function gets and validates the 9 digits entered by the user to fill
the 3 x 3 table.
checkMatrix: This function checks the matrix entered by the user to see if it is a magic square sequence and returns a Boolean as result of test.

Please help a girl out i am completely lost on how to even start it.
@iczebra

Here's a little help to get you started. This program let's you enter numbers 1 thru 9, with no duplicates. Though if you try entering a letter, it'll mess up. The rest of the program is up to you to complete.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>

using std::cout;
using std::cin;
using std::endl;

int main()
{
	int num[9], choose_num;
	for (int x = 0; x < 9; x++)
		num[x] = x + 1;
	for (int x = 0; x < 9; x++)
	{
		do
		{
			cout << "Enter a number from from this list. { ";
			for (int y = 0; y < 9; y++)
			{
				if (num[y]>0)
					cout << num[y] << " ";
			}
			cout << " } ";

			cin >> choose_num;
			if (num[choose_num - 1] == 0)
				cout << "That number was already used. Choose again.." << endl;
		} while (num[choose_num - 1] == 0);
		num[choose_num - 1] = 0;
	}
	return 0;
}
Thank you so much that is what i needed!!!
Topic archived. No new replies allowed.