Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:00, wgdelgado
What is the first step in creating a maintenance ?
Answers: 2
image
Computers and Technology, 22.06.2019 18:10, AdoNice
How can i delete permalinks from a word press site?
Answers: 1
image
Computers and Technology, 23.06.2019 09:00, jeremytheprimerapper
Which best compares appointments and events in outlook 2010appointments have a subject man, and events do notappointments have a specific date or range of dates, and events do notappointments have a start and end time of day, and events do notappointments have a location option, and events do not
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, anamatiascamaja
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
Do you know the correct answer?
One interesting application of two-dimensional arrays is magic squares. A magic square is a square m...

Questions in other subjects:

Konu
Mathematics, 11.09.2020 02:01
Konu
Mathematics, 11.09.2020 02:01
Konu
Mathematics, 11.09.2020 02:01
Konu
Mathematics, 11.09.2020 02:01
Konu
Mathematics, 11.09.2020 02:01
Konu
Mathematics, 11.09.2020 02:01
Konu
Mathematics, 11.09.2020 02:01
Konu
Mathematics, 11.09.2020 02:01
Konu
Biology, 11.09.2020 02:01
Konu
History, 11.09.2020 02:01