Programming with control structures

Assignment Help Basic Computer Science
Reference no: EM13741855

Part D: Programming with Control Structures
Develop a Python program which will calculate the sum of an integer series, as described below. The program wil repeatedly prompt he user to enter a command (a character string). The program wil halt and display the mesage "Program halted normaly" when the command is "exit".
When the command is "squares", the program wil prompt he user to enter the inital integer number in the series and then the number of terms in the series. It wil use repetion to compute the sum of the series, and then display the results. For example, if the inital integer is 2 and the number of terms is 4: Sum = 2^2 + 3^2 + 4^2 + 5^2 = 54 When the command is "cubes", the program wil prompt he user to enter the inital integer number in the series and then the number of terms in the series. It wil use repetion to compute the sum of that series, and then display the results. For example, if the inital integer is 3 and the number of terms is 2: Sum = 3^3+ 4^3 = 91  The program wil display the mesage "** Invalid choice **" if the user enters an invalid command. The program wil use repetion to compute the sums (rather than using a closed form equation). After al, the point is to practice with nest control constructs. You may asume that he user enters integer numbers when prompted for numeric values. 

Reference no: EM13741855

Questions Cloud

Explains effects of the disease on healthy body functions : Prepare report on Huntington's Disease. Explains effects of the disease on healthy body functions, and relates this to signs and symptoms
Linda who works for an intelligence company : Linda who works for an intelligence company is suspected of accessing and possessing digital content pertaining to turtles. Accessing, possessing, or distributing of digital content pertaining to turtles breaches both civil and criminal laws. Linda h..
Options on microsoft stock-disregarding option premium : Consider options on Microsoft stock. Suppose that there are call options with a strike price of $10 and put options with a strike price of $10, both with the expirations date of January 16th. Suppose that there is a 50% chance that the stock price wi..
The interest-only mortgage typically converts later : If the economy was experiencing a severe recession, which of the following combinations of monetary and fiscal policy actions would be most appropriate? Many years ago, the traditional mortgage loan structure specified. The "interest-only" mortgage t..
Programming with control structures : Develop a Python program which will calculate the sum of an integer series, as described below. The program wil repeatedly prompt he user to enter a command (a character string). The program wil halt and display the mesage "Program halted normaly" wh..
What is the optimal order size under eoq : Nittany Shoe Repair estimates annual demand to be 625 pairs of soles.  Holding costs are 20 percent of the unit price.  The cost to place an order is $10. What is the optimal order size under EOQ
Explain how the salk and sabin vaccines provide protection : Polio Vaccine-Using one or more complete sentences, explain how the Salk and Sabin vaccines provide protection against polio
Briefly define the positions on free will and determinism : Select and briefly define one of the three positions on free will and determinism that we have discussed them in class: incompatibilist determinism, incompatibilist libertarianism, or compatibilism.
What will be the partial pressure of co : At equilibrium PCO = 4 bar and PCO2 = 1.5 bar. If the pressure of the CO2 is reduced to 0.5 bar, what will be the partial pressure of CO once equilibrium is reestablished?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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