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, 22.06.2019 14:30
Create a pseudocode design to prompt a student for their student id and the titles of the three classes they want to add. the solution should display the student’s id and a total bill. • bill a student using the following rules: o students can only add up to 3 classes at a time.
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server.so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
What is the main benefit of minimizing the ribbon in word? more options will be accessible through customized keystrokes. more of the document will be viewable without needing to scroll. fewer controls will be accessible to the user by using the mouse. fewer editing options will be available without entering a password.
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
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
Mathematics, 19.03.2021 20:30
question
Mathematics, 19.03.2021 20:30
question
Mathematics, 19.03.2021 20:30
Questions on the website: 13722360