Properties:
1. Each of the elements of the grid contains an integer from 1 through 9, with no number repeated.
2. The sum of each row, column, and diagonal adds up to 15.
2
7
6
9
5
1
4
3
8
Write a program that validates whether a square is "magic" using a two-dimensional 3 x 3 array. It should have a bool function named isMagicSquare, which accepts the array as an argument and returns true if it is a Lo Shu Magic Square and false otherwise. It should test all of the requirements mentioned above.
Test your program with four arrays:
1. One (such as the one above) which is a magic square.
2. One in which all rows, columns, and diagonals add up to 15, but has digits that repeat.
3. One with a digit that is not between 1 and 9.
4. One which uses unique numbers from 1 to 9, but does not satisfy the second requirement mentioned above.