Algorithm for creating magic squares

Assignment Help Other Subject
Reference no: EM13254193

Input: Your program should ask the user to enter an odd integer. For the purposes of this program, treat the input as an unsigned short. Every odd number up to 999 is valid for this program. The program should continue prompting for numbers and printing magic squares until the user enters a zero. If an even number is entered, print an appropriate error message and prompt the user to enter another number.

Output: The program should output the magic squares to a text file. You don’t need to print the boxes around the numbers, but arrange the numbers in columns and rows so the square is readable using print formatting. In addition to the magic square, also print out the magic sum.

Miscellaneous: This program must use functions and arrays. It is your decision how many functions are used and how they are defined. There is an algorithm for creating magic squares; make sure you do your research before tackling this program.

Reference no: EM13254193

Questions Cloud

Compute the mass of each acid necessary : For each of the following acid-base reactions, calculate the mass (in grams) of each acid necessary to completely react with and neutralize 5.15 of the base.
Explain straight-line method of depreciation : Approximately one year later, the hospital is approached by Harmon Technology salesperson, Jane Black, who indicated that purchasing the scanner in 2011 from Faital Inc. was a mistake.
What is the induced emf between the wingtips : An airplane flies due north in a region where Earth's magnetic field has magnitude 5.3×10?5T, declination 0?, and inclination 75?. What's the induced emf between the wingtips, 36 m apart, when the plane flies at 230m/s
How many liters of chlorine gas can be obtained at 40c : How many liters of chlorine gas, Cl2, can be obtained at 40C and787 mmHg from 9.41 g of hydrogen chloride, HCl, according to the following equation 2KMnO4(s) + 16HCl(aq) à 8H2O(l) 2KCl(aq) 2MnCl2(aq) + 5Cl(g)
Algorithm for creating magic squares : This program must use functions and arrays. It is your decision how many functions are used and how they are defined. There is an algorithm for creating magic squares; make sure you do your research before tackling this program.
How does a transistor switch compare to a mechanical switch : How does a transistor switch compare to a mechanical switch In other words, a mechanical switch when it is ON has a zer impedance. What about the transistor switch
Find the average power delivered by the elevator motor : a 753 kg elevator starts from rest. it moves upward for 3.04 seconds with a constant acceleration until it reaches its cruising speed of 2.07 m/s
Define completely neutralize solution : a) how many millileters of 0.120MHCl are needed to completely neutralize 50.0mL of 0.101MBa(OH)2 solution.
Design a handheld hair dryer with the given specifications : Design a handheld hair dryer with the following specifications and realistic constraints: 1. It uses a 60 Hz, single-phase, 120 V r.m.s sinusoidal voltage source. 2. It has three settings low, medium, high.

Reviews

Write a Review

Other Subject Questions & Answers

  Nutritional habits-incorporate to herlifestyle

Identify and describe three new nutritional habits that one could reasonably incorporate into herlifestyle. How could these new habits improve your health?

  Corresponding billing transactions

Relate these steps to the eligibility factor you identified and provide two examples of patient charges with corresponding billing transactions

  What is global crime

What is global crime? How would you reduce the smuggling of migrants?

  Begun a job as a coding specialist at the local hospital

You have just begun a job as a coding specialist at the local hospital. The department manager tells you that when locating and recording diagnostic codes, there are steps that everyone who performs this task should follow. Your friend, Jane, tells y..

  How issue in article-case relates to nature functions of law

Write down 700-1,050 word analysis and be prepared to present how issue in article/case relates to nature, sources and functions of law.

  Prepare argument which comprises three essential elements

Prepare the argument which comprises the three essential elements. Your response must be 150 - 200 words in length. Review and critique at least two of your peers.

  Which organism adjusts successfully to specific environment

The process in which an organism adjusts successfully to a specific environment is called

  Foraging and horticultural societies

Identify and explain the major forms of reciprocity found in both Foraging and Horticultural societies and provide examples regarding how they impact the level of conflict found in these societies?

  Recognize a loss when transferring noncash boot property

A corporation must recognize a loss when transferring noncash boot property that has declined in value and its stock to a transferor as part of a Sec. 351 exchange

  Tash definition of severe disabilities

Please help me to discuss the key elements of the TASH definition of severe disabilities.

  Crime of theft-crime of robbery and crime of extortion

Explain why it is necessary to define the difference between the crime of theft, the crime of robbery, and the crime of extortion, and speculate on what problems might be caused if they were not.

  Public works projects

If a town needs a new road and it's okay to seize property to build the road, or a town needs a school and it's okay to seize property to build a school.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd