You are creating a loop that will capture numbers from the user and add them in...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You are creating a loop that will capture numbers from the user and add them in a total variable. Once totaled a message is displayed depending on the total. Write a program that: Repeatedly reads numbers until the user enters 'done. Once 'done' is entered, break out of the loop. If the user enters anything but a number, capture the error using a try-except construct and display the message "Bad Data" Once 'done' is entered print out one of 2 messages: If the total is greater or equal to 200 then: "The total (the value in the total variable) for the numbers entered is Large" If the total is less than 200 then: "The total (the value in the total variable) for the numbers entered is Small" C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2800.0_x64 Please enter a number to add: 45 Please enter a number to add: 34 Please enter a number to add: 3 Please enter a number to add: fff Bad Data Please enter a number to add: 45 Please enter a number to add: 56 Please enter a number to add: done The total 183 for the numbers entered is Small Process returned 0 (0x0) Press any key to continue execution time : 20.476 s Ac Go You are creating a loop that will capture numbers from the user and add them in a total variable. Once totaled a message is displayed depending on the total. Write a program that: Repeatedly reads numbers until the user enters 'done. Once 'done' is entered, break out of the loop. If the user enters anything but a number, capture the error using a try-except construct and display the message "Bad Data" Once 'done' is entered print out one of 2 messages: If the total is greater or equal to 200 then: "The total (the value in the total variable) for the numbers entered is Large" If the total is less than 200 then: "The total (the value in the total variable) for the numbers entered is Small" C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2800.0_x64 Please enter a number to add: 45 Please enter a number to add: 34 Please enter a number to add: 3 Please enter a number to add: fff Bad Data Please enter a number to add: 45 Please enter a number to add: 56 Please enter a number to add: done The total 183 for the numbers entered is Small Process returned 0 (0x0) Press any key to continue execution time : 20.476 s Ac Go
Expert Answer:
Related Book For
Corporate Finance
ISBN: 978-0077861759
10th edition
Authors: Stephen Ross, Randolph Westerfield, Jeffrey Jaffe
Posted Date:
Students also viewed these programming questions
-
Assume that you are a consultant to Morton Inc., and you have been provided with the following data: D1 $1.00 PO $25.00 and g 6% (constant). What is the cost of equity from retained earnings based on...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Python and most Python libraries are free to download or use, though many users use Python through a paid service. Paid services help IT organizations manage the risks associated with the use of...
-
For each of the following, determine (i) the market in question; (ii) whether a shi in demand or supply occurred, the direction of the shi, and what induced the shi; and (iii) the effect of the shi...
-
This care presents a series of emails between a job candidate who seems to have accepted a job offer and then reneged on the acceptance. The exchange of messages has several communication issues from...
-
How might marketing research be used to support each of the steps in Figure 1-1 that describes the marketing planning process? For example, how could it help select the served market segment?
-
There are two ways that stock can earn returns. These two ways are: a. Through coupon payments and dividends b. Through coupon payments and changes in price c. Through changes in price and dividends...
-
On May 10, 2010, the Horan Company purchased equipment for $25,000. The equipment has an estimated service life of five years and zero residual value. Assume that straight-line depreciation is used....
-
Six months ago, a company purchased stock investments with insignificant influence for $70,000. This is the companys first and only purchase of stock. The current year-end fair value of the stock is...
-
At 11:00 a.m. on July 28, 2022 the Human Resources Manager (HRM) of Middlesex Corporation received an urgent call from the Operations Manager (OM) of that company. The OM informed the HRM that two...
-
Create a Game structure Have it contain fields to hold the following values Name Type (e.g. it may hold something like: card game, board game, TTRPG, chance, etc.) Minimum player count Make sure the...
-
What are the costs and benefits for management of allowing the union to decide how the economic package should be divided? What demands would most likely be advocated by union leaders interested in...
-
How is the Static Theory interpreted with regard to a firm's use and cost of debt? How is it different from the original Modigliani and Miller theories? Why would you argue that different sectors and...
-
I found the weekly discussions to be very interesting as well as beneficial for my learning experience. As the class was online, there was a lack of social experience and bonding that we lacked...
-
This question is about valuation of Bonds. What is the formula you use and what values are selected when you enter it into a financial calculator. 6 2.Using semi-annual compounding, what is the price...
-
The price is rising so high for the chicken, so as a leader, what do you think about how you can handle and solve this crisis, and what will be your leadership strategies explain with mind map
-
Which should drive action planning more, strengths or weaknesses? That is, is it more important to build on your strengths or to reduce your weaknesses? Explain.
-
Assume that United Technologies Corporation is evaluating a proposal to change the companys manual design system to a computer-aided design (CAD) system. The proposed system is expected to save...
-
In 2008 the City of Chicago agreed to lease 35,000 parking meters to a Morgan Stanley-led partnership Morgan Stanley for a one-time sum of \($1.15\) billion. The lease has been criticized as an...
-
Pure White Automatic Laundry must either have a complete overhaul of its current dry-cleaning system or purchase a new one. Its cost of capital is 18 percent. Pure Whites accountant has developed the...
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App