Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, i need this code in JAVA and include all the methods. Please run the code yourself before you upload the answer to see if
Hi, i need this code in JAVA and include all the methods. Please run the code yourself before you upload the answer to see if there is any problem with the code and only submit if it actually works. Thanks!
Magic Square 27615 9 5 1-15 43815 15 15 15 15 The constant that is the sum of every row, column and diagonal is called the magic constant or magic sum, M Every normal magic square has a unique constant determined solely by the value of n, which can be calculated using this formula In this assignment, you are to write a program that takes a 2-dimensional array of ints as input and determines if it is in fact a normal magic square. You will need to implement each of the following methods public static int magicSum(int[Ill array) public static boolean rowsAreAllEqualToMagicSum(int[I array) public static boolean columnsAreAllEqualToMagicSum(int[I array) public static boolean diagonalsAreBothEqualToMagicSum(int[Il array) public static boolean isMagicSquare(int[I] array) public static boolean isNormalMagicSquare(int[I array) public static int getSumOfDownDiagonal (intl array) public static int getSumOfUpDiagonal (int[ array) public static int getSumOfRow(int[)l) array, int index) public static int[] getColumn(int[Il] array, int index) public static int getSumOfColumn(int[] array) You should test your program using a variety of 2-dimensional arraysStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started