Display the heading. Part 2 Write a while loop that will: o Call a function that...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Display the heading. Part 2 Write a while loop that will: o Call a function that will prompt the user to enter a price. The price must be a float. If a value is entered in an invalid format a message will display and the user will be prompted to enter another price, otherwise return the value in price. o Call a function that will prompt the user to enter a quantity. The price must be an integer. If a value is entered in an invalid format a message will display and the user will be prompted to enter another quantity, otherwise return the value in quantity. o Compute the total by multiplying quantity times price. o Display the totals in the format shown in the sample screenshot. o Prompt the user to enter another line item. If the user enters a y continue, if the user enters an n end the program. Write and test the code for the lab. Screen shot of sample results: The Invoice Line Item Calculator Enter price: 12 Enter quantity: 10 PRICE: QUANTITY: 10 TOTAL: 120.00 Enter another line item? (y/n): y 12.00 Enter price: 12,60 Invalid decimal number. Please try again. Enter price: 12.60 Enter quantity: 10.4 Invalid integer. Please try again. Enter quantity: 10 PRICE: QUANTITY: TOTAL: 126.00 Enter another line item? (y/n): n 12.60 10 Display the heading. Part 2 Write a while loop that will: o Call a function that will prompt the user to enter a price. The price must be a float. If a value is entered in an invalid format a message will display and the user will be prompted to enter another price, otherwise return the value in price. o Call a function that will prompt the user to enter a quantity. The price must be an integer. If a value is entered in an invalid format a message will display and the user will be prompted to enter another quantity, otherwise return the value in quantity. o Compute the total by multiplying quantity times price. o Display the totals in the format shown in the sample screenshot. o Prompt the user to enter another line item. If the user enters a y continue, if the user enters an n end the program. Write and test the code for the lab. Screen shot of sample results: The Invoice Line Item Calculator Enter price: 12 Enter quantity: 10 PRICE: QUANTITY: 10 TOTAL: 120.00 Enter another line item? (y/n): y 12.00 Enter price: 12,60 Invalid decimal number. Please try again. Enter price: 12.60 Enter quantity: 10.4 Invalid integer. Please try again. Enter quantity: 10 PRICE: QUANTITY: TOTAL: 126.00 Enter another line item? (y/n): n 12.60 10
Expert Answer:
Answer rating: 100% (QA)
Heres a Python code that implements the described functionality u... View the full answer
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these programming questions
-
Write a while loop with a sentinel value This while loop ends when the user enters a 1, the sentinel value Assign the number 8 to a variable which will serve as the sentinel value Condition: while...
-
1. Based on the code below, answer these questions: Which line will be executed if the condition in line 3 is true? Processing then will proceed to which line? Which line will be executed if the...
-
5. Did Danone follow the advice regarding JVs in China mentioned in the list just above? Which aspects did it follow and which did it not? Danone's Wrangle with Wahaha In 1996, In 1996, Danone Group...
-
Karen Austin Corporation has capitalized software costs of $800,000, and sales of this product the first year totaled $420,000. Karen Austin anticipates earning $980,000 in additional future revenues...
-
Explain how the oxidation of molecules inside cells differs from the burning of substances outside cells.
-
Describe what happens to a bar magnet placed in the nonuniform external magnetic field shown in Figure P27.12. Data from Figure P27.12 Figure P27.12 SN
-
Austin Corporation prepares monthly cash budgets. Here are relevant data from operating budgets for 2012.. All sales and purchases are on account. Budgeted collections and disbursement data are given...
-
_____ redirects a user from a legitimate website to a malicious website by changing hosts files on a DNS server. A. Exploitation framework B. ARP poisoning C. DDoS DNS attack D. DNS...
-
The vice-president of sales and marketing, Madison Tremblay, is trying to plan for the coming year in terms of production needs to meet the forecasted sales. The board of directors is very supportive...
-
Java Programming Problem Description For this assignment, you will design a set of classes that work together to simulate a cars fuel gauge and odometer. The classes you will design are as follows:...
-
In recent years, governments have taken control of banks through buying their shares. What impact does this have on the lending culture of these banks? Is this consistent with shareholder...
-
Firm A and Firm B have debttotal asset ratios of 70 per cent and 30 per cent, and returns on total assets of 20 per cent and 30 per cent, respectively. Which firm has a greater return on equity?
-
Ingrid: I cannot believe it has been a month since I took sick leave from Triple A. I am feeling so much better now but the thought of going back to work and working with Carmel terrifies me. Why,...
-
After almost 500 years of a particularly exploitative form of colonial rule, a failed socialist experiment and a bloody civil war, Mozambique underwent radical economic adjustment in the late 1980s...
-
Considerable evidence exists that supportive managerial and supervisor behaviours in environment initiatives are important in developing employee engagement in environmental management (EM). For...
-
What information is contained in the branches of cladogram? A. a current species and its descendants B. a recent common ancestor and two outgroups C. all species classified in a particular genus D....
-
Record the following selected transactions for March in a two-column journal, identifying each entry by letter: (a) Received $10,000 from Shirley Knowles, owner. (b) Purchased equipment for $35,000,...
-
Create a series of CRC cards for Worlds Trend Catalog Division. Once an order is placed, the order fulfillment crew takes over and checks for availability, fills the order, and calculates the total...
-
The five-year-old TowerWood hotel chain needs help designing its Web site. The company maintains properties in all the large U.S. tourist communities such as Orlando, Florida (near Disney World);...
-
How does a project manager assess the risk of things going wrong and take that into consideration when planning the time needed to complete the project?
-
Indonesia produces about 60 percent of the worlds palm oil. Palm oil is used in the production of shampoo, ice cream, and chocolate. Assume that Switzerland does not produce palm oil but companies in...
-
An article in the Wall Street Journal stated that Chinas treatment of American know-how has been a central issue to U.S.-China trade tensions over the past five years. a. What does the article mean...
-
An article in the Wall Street Journal explained that despite rising national security tensions between the United States and China in 2023, trade between the two nations was rising. China is a...
Study smarter with the SolutionInn App