subject

Write a program that uses a 3 3 3 array and randomly place each integer from 1 to 9 into the nine squares. the program calculates the magic number by adding all the numbers in the array and then divid- ing the sum by 3. the 3 3 3 array is a magic square if the sum of each row, each column, and each diagonal is equal to the magic number. your program must contain at least the following functions: a function to randomly fill the array with the numbers and a function to deter- mine if the array is a magic square. run these functions for some large number of times, say 1,000, 10,000, or 1,000,000, and see the number of times the array is a magic square.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What side length would you specify if you were required to create a regular hexagonal plate that was composed of 33 cm(squared) of sheet metal? dimension the side length to 0.1 cm
Answers: 2
question
Computers and Technology, 23.06.2019 05:20
What did creator markus “notch" persson initially call his game
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Under the home tab, where can a user find options to change the bullet style of an outline? in the slides group in the font group in the paragraph group in the drawing group
Answers: 1
question
Computers and Technology, 25.06.2019 01:40
The instantiation of an endpoint in a potential tcp connection is know as
Answers: 1
You know the right answer?
Write a program that uses a 3 3 3 array and randomly place each integer from 1 to 9 into the nine sq...
Questions
question
English, 29.09.2019 07:30
question
Biology, 29.09.2019 07:30
question
Mathematics, 29.09.2019 07:30
question
History, 29.09.2019 07:30
Questions on the website: 13722359