Question: Write a program that tests whether a 3 x 3 array, input by the user, is a magic square. A magic square is an NxN
Write a program that tests whether a x array, input by the user, is a magic square. A magic square is an NxN matrix of numbers in which every number from to N must appear just once, and every row, column and diagonal must add up to the same total. The design should follow the VTOC below. Declare your array in main. Design a method for inputting the array. Get one whole row at a time from the user. Design a method for testing the array as a magic square. This method should return a Boolean true if it is a magic square. Inform the user accordingly and then ask if the user wants to repeat the algorithm. Use appropriately designed and worded prompts. Test your program using the following square:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
