Question: with an output of the code 7. Create a new program and save it as Magic.java. Thereafter, the user will be asked to input the

 with an output of the code 7. Create a new program

with an output of the code

7. Create a new program and save it as Magic.java. Thereafter, the user will be asked to input the size of the table (use ODD number for your row and column size). The program shall display in matrix form the content of the table from 1 to the last element where the sum of all the rows, columns, and diagonals are ALL EQUAL! This is called your magic square. Use loops. Example Output 1: Do you want to try again? Y Note that if you add all the rows it will be equal to 15. If you add all the columns it is still equal to 15 . And if you add numbers diagonally, it is still equal to 15. That is why it is called the MAGIC SQUARE! Example Output 2: Input size of Magic Square: 5 Output: 17234101124561218171319258142021215162239 Do you want to try again? N HINT: There is a pattern in making a magic square. The pattern is also called an algorithm. Find the algorithm and transform it into a Java code and you can create any magic square with an ODD value for the size of its row and column

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!