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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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