Discussion Section 9: Two-Dimensional Arrays
Due: 10pm Tuesday March 27
Purpose: In this discussion section, you will
practice manipulating two-dimensional arrays of integers.
A user will give a file that contains many two dimensional arrays, and the main method will call isMagic to test if each array is a magic square. The file format will be an integer that indicates the dimensionality n of the square, and then n rows of n integers. A test case file is here. Your program will output whether or not the square is a magic square. A sample output is given here.
Your goal is to complete the MagicSquare class by implementing isMagic method. To help you get started, the part that computes the sums of rows and the main method are already given in the template here. Make sure to copy the test case file into your project directory.
Your program should be internally correct (sound logic) and
externally correct (following Java style guideline).