Lab 4-2Due: Sun, Feb 24, 11:59pm
|
MAGIC SQUARES
Call a square matrix a "magic square" if the sum of each row, the sum of each column, and the sum of the (main) diagonal are all equal to the same number. As an easy example, if all the entries of the matrix are equal, then it is a magic square. Write a program which determines whether a given 4 by 4 matrix is a magic square. Assume that the entries are integers. Be sure to use a 2 dimensional array to store the input. Your program should let the user repeat the computation before quitting the program.
Requirement | Points |
---|---|
Good user interface | 15 |
Correct determination of magic squares for all sets of input | 70 |
Complete source code with good formatting, variable names, and comments | 15 |
Total | 100 |