subject

One interesting application of two-dimensional arrays is magic squares. A magic square is a square matrix in which the sum of every row, every column, and both diagonals is the same. Magic squares have been studied for many years, and there are some particularly famous magic squares. Write a program to determine whether a series of square matrices are magic or not. The first line of input for each square specifies the size of the square (number of rows and columns). The square elements follow, one row per line. The end of the data is indicated by -1. Create a class called Square that has methods to construct a square of a specified size, to read in the elements of the square, to compute the sum of a row, to compute the sum of a column, to compute the sum of each diagonal, and to test to see if the square is magic. A driver should read in the dimension of each square, call the Square class to construct the square, print out the square and the various sums of rows, columns and diagonals; and prints out the result of the magic square test.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 20:40
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
Perform an online search about the booting process of a computer and list all the steps
Answers: 2
question
Computers and Technology, 24.06.2019 08:30
Why might you choose to create a functional resume
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
When writing a business letter, how many times can you use the same merge field in a document? once once, unless using the address block feature unlimited it will depend on the type of document you choose
Answers: 1
You know the right answer?
One interesting application of two-dimensional arrays is magic squares. A magic square is a square m...
Questions
question
Business, 02.06.2021 14:00
question
Health, 02.06.2021 14:00
question
Mathematics, 02.06.2021 14:00
question
Mathematics, 02.06.2021 14:00
question
Chemistry, 02.06.2021 14:00
Questions on the website: 13722363