Lab 4-2

Due: Sun, Feb 25, 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 10
Correct determination of magic squares for all sets of input 60
Complete source code with good formatting, variable names, and comments 5
Total 75