CS1043 Lab 10 Purpose of this lab is to work with a two dimensional array and a Java IDE. 1. A Magic Square is an n-by-n matrix (two-dimensional array) that is filled with the numbers 1,2,3, …, n2, such that the sum of the elements in each row, in each column, and in the two diagonals is the same value. For example, 16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1 is a “Magic Square” since all of the numbers from 1 to 16 are used exactly once, and since all row sums, all column sums and the sum of both diagonals is the same, 34. Note the following 3 by 3 matrix (array) is NOT a magic square 1 6 4 8 2 9 5 7 3 2. Write Java code that initializes two 2-dimensional arrays in the declaration statements. Use the two 2-dimensional arrays shown above. 3. Write a method to return a String with the 2-dimensional array in a row and column format. 4. Determine if each array is or is not a magic square. 5. Print a message after each 2-D array to indicate if the array is or is not a magic square. 6. In detail, the pseudo code for the main function in Lab8 is as follows: Declare and initialize two separate two-dimensional integer arrays each containing the data values shown in the 4 by 4 matrix table and the 3 by 3 matrix table shown in step one of this lab above. Write a constructor to instantiate an instance field to hold the 2-D array. Write an instance method named toString to return a String containing a table with rows and columns of output. Write an instance method called isAmagicSq to determine if the 2-D array is or is not a magic square. o Sum one of the main diagonals. o Sum the other diagonal. If the two diagonal sums are not equal, return false. o Write a nested loop for summing each row. Compare each sum against the first diagonal. If any sum is not equal to the diagonal, return false. o Write a nested loop for summing each column. Compare each sum against the first diagonal. If they are not equal, return false. o If you make it this far without exiting, return true. Based on the return result of the isAmagicSq instance-method, the main method should output a message that states if the two-dimensional array IS or IS NOT a Magic Square. /* example code is given here: */ public class MagicSquare { public static void main( String [] args ) { int [][] square3 = { {1, 6, 4}, {8, 2, 9}, {5, 7, 3} }; MagicSquare case1 = new MagicSquare( square3 ); String table = case1.toString( ); // Display the table if ( case1.isAmagicSq( ) ) System.out.println( "... is a magic square ... " ); else System.out.println( "... is not a magic square ... " ); // Repeat for the 4x4 square here. } /* Write the constructor and two instance methods here. 1. Write a constructor to create a deep copy of the 2-D array formal parameter. There sh.