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

  Does use of contractions development of new communication

Does the use of contractions, slang and icons in text messaging and email signal the development of a new communication style, or just the death of appreciation of written language?

  Approach of night our body temperatures begin to drop

With the approach of night our body temperatures begin to drop. This best illustrates the dynamics of the?

  Discuss the ending of the handler

What does it mean for humanity that the things people do are gradually being replaced by machines? Discuss the ending of "The Handler." Answer the question: Who can replace a man?

  Theory of negligence in lawsuit case study

Discuss the negligence or other theory for recovery in the suit Chancit's widow has brought against Ford Motor Company, the makers of the Ford Fairlane.

  Population-based approach to prevent childhood obesity

Some authorities have indicated that children spend as much time watching television as they do in school, and studies indicate a correlation between high television viewing in children with obesity.

  Make sure bibliographic reference

That is fine but please make it five instead of 4 papers with summary of the articles books or text or internet not (google)make sure bibliographic reference for each one.

  Active verbs-re-write a sentence

We are doing Active verbs and I have to re-write a sentence. Original Sentence- Her letter was in acknowledgment of the student's participation in the literacy program.

  Recollection of an emotional event

memory refers to a vivid detailed recollection of an emotional event.

  Definition of the sophist idea of justice

Thrasymachus Sophist has defined Justice as the interest of the stronger parties. In light of Socrates considered view of Justice as expounded over course of Republic

  Five major categories of hazards

Based on your knowledge, experiences, and the weekly readings, analyze two of the five major categories of hazards associated with terrorism. Be sure to include which type of attack would be most logical to conduct in the United States and why?

  Write thesis sentence stating piece of entertainment

Write down thesis sentence stating how and why it is more than just the piece of entertainment. Thesis should include why it is legitimate form of popular culture.

  Effect on attributes-entities and relationships

Given the business rule "an employee may have many degrees" discuss its effect on attributes, entities, and relationships.

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