Lab 4-2

Due: Sun, Feb 26, 11:59pm

 

payrol

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.

Grading Table

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