Programming with control structures

Assignment Help C/C++ Programming
Reference no: EM13763692

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: EM13763692

Questions Cloud

What tools chris used to take pictures of kayak prototypes : This project will have you validating forensic images, processing the data forensically by conducting key word searches and locating graphic files, as well as, finding EXIF data in the photos to determine what tools Chris used to take pictures of ..
Create a crisis action plan and compose a positive reply : Create a crisis action plan and compose a positive reply to send to Mr. Ward to handle this bad news situation.
Present the major claims of singer : "America's Shame." Now, you will compose a researched response to this article. Present the major claims of Singer
Sec reporting requirements : Based on your review of the SEC reporting requirements as outlined in the Sarbanes-Oxley Act, assess the adequacy of the reporting requirements for providing credible financial and operating information for company stakeholders and potential inves..
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).
Examination financial information for huffman trucking : Examine financial information for Huffman Trucking, within the Virtual Organization web link located on the course materials page.
Presentation for upper level management : Prepare a presentation for upper level management to explain the process by which a privately held company would transition to publicly held company.
Program to prompt the user for an arithmetic choice : The main menu of your program is to continue to prompt the user for an arithmetic choice until the user enters a sentinel value to quit the calculator program.
Governmental or not-for-profit organization : Is this a governmental or not-for-profit organization (NFPO)? Explain your answer in detail. Support your response with a narrative containing facts or other relative information.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Calculate and display the number of units of electricity

The manager of PG&E wants a program that calculates a customer's electric bill. He will enter the current and previous meter readings.

  Use selection sort to sort a[48] into increasing order

Use selection sort to sort A[48] into increasing order, and then print out the sorted list in four rows. There may be duplicates, but that's OK. (65 and 53 appear twice.) Duplicates will appear next to each other in the sorted list.

  Implement function types that takes no input

Implement function types that takes no input, declares 3 variables of type char, 3 of type short, 3 of type int, and 3 of type double.

  A series of one-digit non-negative numbers

Write a program that asks the user to enter a series of one-digit non-negative numbers

  Write an entire c++ program that reads a positive integer

Write an entire C++ program that reads a positive integer entered by an interactive user and then prints out all the positive divisors of that integer in a column and in decreasing order.

  Build a method for performing frequency analysis

Build a basic cipher base class that may be derived from for the ciphers and decode a Caesar Cipher text. You will have two cases.

  Write code that declares an int array named month

Write code that declares an int array named month with 5 rows and 7 coloumns and initializes every element to -1.

  Grocery store program

This program draws upon several concepts that were covered in CptS 121 and should serve as a good refresher for CptS 122. Our store, Cougar Mart, maintains its inventory in a text file. Not being very tech savvy, the owner of Cougar Mart needs you to..

  Create a serial object s

The function call operator is overloaded and will generate a sequential integer each time the operator is used and the object can be created with the sequence start value specified.

  Express the definition of the class rectangletype

The definition of the class rectangleType and the definitions of the operator functions are.

  Write a program in which the user is prompted

Write a program in which the user is prompted for the number of values that they will be entering. The user then enters that number of integers into an array

  Properly store the number from variable value

1. Statement will properly store the number from variable  value  into the output file object AnsFile?

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