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

  Discuss the issues of encryption and key management

Discuss the issues of encryption and key management in cloud computing, how it different for personal computers and traditional enterprising computing environments.(1300-1400 words)

  Build a thread system

Stock Nachos has an incomplete thread system. In this assignment, your job is to complete it, and then use it to solve several synchronization problems.

  Calculations without an arithmetic and logic unit (alu)

Determine whether or not it is not possible for microprocessors to perform calculations without an Arithmetic and Logic Unit (ALU)

  The sum of the angles of a triangle is always 180

The sum of the angles of a triangle is always 180. Get two angles from the user and display what the final angle must be in order to complete the triangle. Run the program to see the exact format of the output.

  What is the probability that a dishonest claimant

What is the probability that a dishonest claimant is falsely verified as an authentic entity, i.e., what is the probability that the dishonest claimant responds correctly to all 11 challenges?

  Research details of ad of current web site or magazine

Pick a current web site or magazine ad for a complete, working computer system, including computer, monitor, keyboard, and software, together with extra devices such as a mouse or printer

  Using a truth table or equivalent determine following

Using a Truth Table or equivalent determine

  What is the time complexity of the better method

Modern object-oriented software makes extensive use of the malloc and free operations. Unfortunately, they are generally quite expensive (in time) and thus efficient routines are important.

  Briefly mention the set of ai-based rules

You are to develop AI behind a generic Tic-Tac-Toe game, where a player can pay against computer. Briefly mention the set of AI-based rules that have to check on either side to decide the next move in a game. How would you determine a winner/cat's..

  How would you communicate the design of method to developer

How would you communicate the design of method to a developer that must implement a complex algorithm and ensure that they implement correctly when provided good inputs as well as handle bad input and no input scenarios?

  Prompt the user to enter a string

Prompt the user to enter a string, and using a loop, count and output the number of vowels, and consonants the string contains. (find methods from class Character to help you.)

  Where do othe researchers drop ff the ewaste

Where do othe researchers drop ff the ewaste and where does it end up?

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