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

  Write an application that creates a quiz

Write an application that creates a quiz, which contains at least 5 questions about a hobby, popular music, astronomy, or any other personal interest.

  Find the largest element and print out the index and value

Write a function maxv() that returns the largest element of a vector argument. Find the largest element and print out the index and value.

  Demonstrate the results of the computation

Design a Windows based application that should read or extract data from an outside source (preferably from other Microcontroller). Carry on a particular computation on the data. Demonstrate the results of the computation through the application.

  Write a program that accepts as input a string variable

Write a program that accepts as input a string variable called strFirstName, then another string variable called strLastName, and an integer variable called intAge.

  Write a program using vectors and iterators

Create a program that uses at least two functions that will be called from your main. This program is a number game program that asks for parts of your phone and after manipulating it mathematically, eventually outputs your entire phone number. The d..

  Dynamic character arrays

Dynamic character arrays str and add contain strings. Write a function append that uses str and add as arguments and appends add to the end of str. Write a main program that illustrates the use of function append to concatenate five strings.

  Prepare a c program that has this description

n is an integer, >= 0. x points to the first element of an int array with n position. p points to the first element of another int array array, also with n position.

  C++ programming uml diagrams

The goal of this lab is to better familiarize you with polymorphism and the factory design pattern, two key components in Assignment

  Program reads in and prints three bowling scores

The main program reads in and prints three bowling scores, score1, score2, and score3. It then calls a series of functions to process these scores.

  Create a simple home utility auditing program.

Design, implement, test, and debug a Visual Basic® program to create a simple home utility auditing program.

  Program that read in from the key board a string

Write a complete C++ program that read in from the key board a string and convert all letters in the string to upper cases. You are not allowed to use toupper function.

  User that will be asked to input the time

Write a code for the following C++ problem. We will have a user that will be asked to input the time of a train traveling in terms of minutes and this minutes is a non-negative integer.

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