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

  Computer forensics examiner get involved with, and how

Other than the two basic types of computer crimes above, what non-computer crimes might a computer forensics examiner get involved with, and how?

  Write code application using a sub procedure

I need to code an application using a sub procedure to boh calculate and display a 10% bonus, use a sub procedure named ClearLabel to clear the contents of the bonusLabel whne the TextChanged even occurs for either text box

  What are the reasons for your choices

Discuss three principles that you found to be the most surprising or helpful in, the following website: " Biggest Mistakes in Web Design, 1995-2015." What principles will you apply to your own site design? What are the reasons for your choices?

  Use a triangle to indicate the challenges and bus processes

Use a triangle to indicate the challenges and bus processes changes

  Will ibms plan to give away some of its it assets

Will IBM's plan to give away some of its IT assets and intellectual property and increase support of opensource software products like linux ,be a successful growth strategy in the "brutally competitive marketplace" in which it operates?why OR WHY..

  Patient care applications

Patient care applications

  Show the binary results for operations

Show the binary results for the subsequent operations using a 5-bit word - 2's complement arithmetic (8-16) and (12-13);

  What is the lowest and highest addresses

Assume a 2^20 byte memory what is the lowest and highest addresses if memory is word addressable, assuming a 32-bit word.

  In mips assembly language

In MIPS Assembly language

  Why cannot technology totally solve problem of co-channel

Ultra Wide Band (UWB) appears like noise to other transmitters. Why cannot this technology totally solve the problem of co-channel interference for any type of wireless communication?

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs, Flash RAM, and solid-state drives (SSD)

  Change the layout options to square

Change the layout options to Square

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