1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
coldgirl [10]
4 years ago
15

There is a simple method for constructing a magic square for any odd value of n:

Computers and Technology
1 answer:
DaniilM [7]4 years ago
3 0

Answer:

See Explaination

Explanation:

class MagicSquare():

def __init__(self,side):

self.side=side

self.two_dimension=[]

for row in range(1,side+1):

row_line=[]

for col in range(1,side+1):

row_line.append(0)

self.two_dimension.append(row_line)

def display(self):

row=0

col=int((self.side-1)/2)

for i in range(1,self.side**2+1):

self.two_dimension[row][col]=i

row-=1

col+=1

if row==-1:

row=self.side-1

if col==self.side:

col=0

if self.two_dimension[row][col]==0:

continue

else:

row+=1

if row==self.side:

row==0

for line in self.two_dimension:

for num in line:

print("{0:>3}".format(num),end=" ")

print()

def main():

for i in range(1,14,2):

square=MagicSquare(i)

square.display()

print("----------------------------------------------------")

if __name__ == '__main__':

main()

You might be interested in
Which statements accurately describe the Bookmark feature in the Audio/Video control bar? Check all that apply.
lukranit [14]

d)it is used quickley locate an important starting spot playback

7 0
3 years ago
Describe how learning can be accessed in your class?​
SpyIntel [72]

There are four main learning styles used in classrooms today: Visual, auditory, reading/writing, and kinesthetic.

8 0
3 years ago
The video game machines at your local arcade output coupons depending upon how well you play the game. You can redeem 10 coupons
Lilit [14]

Answer:

coupons = int(input("Enter the number of coupons you win: "))

candy_bars = int(coupons / 10)

gumballs = coupons % 10

print("Candy bars: " + str(candy_bars) + ", Gumballs: " + str(gumballs))

Explanation:

*The code is in Python.

Ask the user to enter the number of coupons

Calculate the number of candy bars, divide the coupons by 10 and typecst the result to int

Calculate the number of gumballs, use the modulo to find the remainder

Print the values

3 0
3 years ago
>>> import math >>> print(math.Pi) 3.141592653589793 >>> def print_volume(): print ("What is the radi
kvasek [131]
I have no clue what this is asking...
8 0
3 years ago
A company is experiencing overwhelming visits to a main web server. The IT department is developing a plan to add a couple more
Varvara68 [4.7K]
The answer is C) Availability.

Although the company is addressing scalability by adding more servers, the question is asking for security requirement. Therefore we need to choose one of the principles from CIA triad which includes confidentiality, integrity, and availability.

Integrity involves keeping the data accurate and confidentiality involves keeping the data between the sender and intended recipient(s). That being said, scalability and availability are the possible answers.

C) Availability is the best answer because it is part of the CIA triad.

Note: Another resource to look at for cyber security principles would be the Parkerian Hexad.
5 0
3 years ago
Read 2 more answers
Other questions:
  • In order to plan George’s birthday, his father gave him a list of people who attended his birthday for the last five years. What
    8·2 answers
  • Match each item with a statement below. a device used in mobile devices to sense the physical position of the device an area whe
    11·1 answer
  • In the processes tab of task manager, the ____ tab displays the âworking setâ of a process, or the amount of memory it is active
    12·1 answer
  • What is 450 g of flour a measure of?
    11·1 answer
  • In his article “is google making up stupid” Nicholas Carr uses a metaphor to suggest that
    11·2 answers
  • . Virtualization simplifies the use of resources, isolates users from one another, supports replication and mobility, but exacts
    7·1 answer
  • Websites whose URL’s contain tildes (~) are usually published by the government. TRUE or FALSE.
    8·2 answers
  • Which of the following examples can be solved with unsupervised learning?
    8·1 answer
  • Rolulzoss<br>A. State three positive uses of computers in the government sector​
    10·1 answer
  • If you forget your privacy password what will you do if the ask this question what is the name of one of your teacher?​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!