Question: Part B [15 points]: This assignment extends from Part A that you have implemented previously. Recall that in Part A, a grid is drawn for
![Part B [15 points]: This assignment extends from Part A that](https://s3.amazonaws.com/si.experts.images/answers/2024/06/667952e8e3fd9_112667952e8ca48a.jpg)

Part B [15 points]: This assignment extends from Part A that you have implemented previously. Recall that in Part A, a grid is drawn for filling in a 4 x 4 square of cells containing integers. For this part of the assignment, first you will need to implement a method that verifies whether a given 4 x 4 square (containing 16 values) is a Magic Square. A Magic Square for the purpose of this assignment is that the values in any horizontal row, vertical column or main diagonals add up to the same value. You will be using 2-dimensional arrays for storing and processing the values stored in a square. Here is the header for the above method: 1 * * This method verifies whether a given square is a magic square or not parameter squareData is a symmetrical 2 - dimensional array of integers * returns true if the square is magic if all rows or columns , or two main diagonals add up to same value * return false otherwise private static boolean isSquareMagic (int squareData ) ; Notes : 1. Implement the above method in the same class from Part A ( MagicSquare .java ) 2. Once implemented , test this method with squares that are both magic and otherwise . In other words, call this method from the main method in class MagicSquare .java 3. For testing, you need data. For a valid Magic Square, use the data from the grid below: CSC 142 Magic Square 4. For example, here is how the values in the above grid can be stored in using a 2-dimensional array: int squareData = {{8, 11, 14, 1 }, {13,2,7, 12 }, {3, 16,9,6 }, ( 10,5, 4, 15 }}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
