? ? Note: When accuracy is essential, floats are not used to represent currency due to rounding
Fantastic news! We've Found the answer you've been seeking!
Question:
?
?
Transcribed Image Text:
Note: When accuracy is essential, floats are not used to represent currency due to rounding and accumulation errors Python provides several primitives specifically developed to implement financial applications However, these topics are beyond the scope of this lat Output each floating point value with two digits after the decimal point, which can be achieved as follows print('[:.2f) format (your value)) (1) Prompt the user to input a food item name, price, and quantity Output an itemized receipt (Submit for 2 points) Note: This zylab outputs a newline after each user-input prompt For convenience in the examples below the user's input value in shown on the next line, but such values dont actually appear as output when the program runt Enter food item name: hot dog Enter ites price: 2.00 Enter item quantity: $ RECEIPT 5 hot dog $2.00 $10.00 Total cost: 410.00 (2) Extend the program to prompt the user for a second item. Output an itemized receipt. (Submit for 2 points, so 4 points total) Enter food item name: hot dog Enter item price: 2.00 Enter item quantity: 5 RECEIPT 5 hot dog @ $2.00 $10.00 Total cost: $10.00 Enter second food item name: ice cream Enter item price: 2.50 Enter item quantity: 4 RECEIPT 5 hot dog @ $2.00 = $10.00 4 ice cream @ $2.50 - $10.00 Total cost: $20.00 (3) Extend again to output a third receipt that adds a mandatory 15% gratuity to the total cost. Output the total cost, the cost of gratuity, and the grand total. (Submit for 3 points, so 7 points total) Enter food item name: hot dog Enter item price: 2.00 Enter item quantity: 5 RECEIPT 5 hot dog @ $2.00 $10.00 Total cost: $10.00 Enter second food item name: ice cream Enter item price: 2.50 Enter item quantity: 4 RECEIPT 5 hot dog @ $2.00 - $10.00 4 ice cream @ $2.50 $10.00- Total cost: $20.00 15% gratuity: $3.00 Total with tip: $23.00 Note: When accuracy is essential, floats are not used to represent currency due to rounding and accumulation errors Python provides several primitives specifically developed to implement financial applications However, these topics are beyond the scope of this lat Output each floating point value with two digits after the decimal point, which can be achieved as follows print('[:.2f) format (your value)) (1) Prompt the user to input a food item name, price, and quantity Output an itemized receipt (Submit for 2 points) Note: This zylab outputs a newline after each user-input prompt For convenience in the examples below the user's input value in shown on the next line, but such values dont actually appear as output when the program runt Enter food item name: hot dog Enter ites price: 2.00 Enter item quantity: $ RECEIPT 5 hot dog $2.00 $10.00 Total cost: 410.00 (2) Extend the program to prompt the user for a second item. Output an itemized receipt. (Submit for 2 points, so 4 points total) Enter food item name: hot dog Enter item price: 2.00 Enter item quantity: 5 RECEIPT 5 hot dog @ $2.00 $10.00 Total cost: $10.00 Enter second food item name: ice cream Enter item price: 2.50 Enter item quantity: 4 RECEIPT 5 hot dog @ $2.00 = $10.00 4 ice cream @ $2.50 - $10.00 Total cost: $20.00 (3) Extend again to output a third receipt that adds a mandatory 15% gratuity to the total cost. Output the total cost, the cost of gratuity, and the grand total. (Submit for 3 points, so 7 points total) Enter food item name: hot dog Enter item price: 2.00 Enter item quantity: 5 RECEIPT 5 hot dog @ $2.00 $10.00 Total cost: $10.00 Enter second food item name: ice cream Enter item price: 2.50 Enter item quantity: 4 RECEIPT 5 hot dog @ $2.00 - $10.00 4 ice cream @ $2.50 $10.00- Total cost: $20.00 15% gratuity: $3.00 Total with tip: $23.00
Expert Answer:
Related Book For
Posted Date:
Students also viewed these mechanical engineering questions
-
Create a Visual Logic flow chart with four methods. Main method will create an array of 5 elements, then it will call a read method, a sort method and a print method passing the array to each. The...
-
Write a program that asks the user to input a vector of integers of arbitrary length. The program then counts the number of elements, the number of positive elements, and the number of negative...
-
Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input should be terminated when the user enters a sentinel character. The...
-
Determine the range of the 2x function y = 3 sec 3
-
Focus groups are one of the advertising researcher's most versatile tools. Describe the basic features of focus group research that could lead to inappropriate generalizations about the preferences...
-
Diego Company has three employees - a consultant, a computer programmer, and an administrator. The following payroll information is available for each employee: * For hourly employees, overtime is...
-
During the assembly of an exhaust valve, sufficient distance must be maintained between the valve tip and the cylinder wall. If \(85 \%\) of valve assemblies have the required distance, use Table 1...
-
Gator Beach Marts, a chain of convenience grocery stores in the Fort Lauderdale area, has store hours that fluctuate from month to month as the tourist trade in the community varies. The utility...
-
Based on the following information, compute cash flows from financing activities. Purchase of short-term investments Dividends paid Interest paid Additional short-term borrowing from bank $ 630 890...
-
Since the early 1990s, woodstove sales have declined from 1,200,000 units per year to approximately 100,000 units per year. The decline has occurred because of (1) stringent new federal EPA...
-
0 Consider a Stackelberg duopoly, where Firm 1 (who moves first) and Firm 2 face market demand QD(P) = 1 - P. Marginal cost of each firm is constant and equal to zero. A) Find the equilibrium...
-
what is one of the disadvantages of incorporating continual improvement as a facility management goal.
-
Find the current balance for the account. Balance from Bank Statement Outstanding Checks Deposits Not Yet Recorded $4625.22 $78.43 $327.94 $982.41 $922.29 $821.27
-
Refer to the following selected financial information from Helpful Hardware. Compute the company's days' sales in inventory for Year 2. (Use 365 days a year.) Merchandise inventory Cost of goods sold...
-
Using the information below, compute the raw materials inventory turnover: Raw materials used $ 1 4 5 , 6 0 0 Beginning raw materials inventory 1 9 , 2 0 0 Ending raw materials inventory 2 1 , 4 0 0
-
why can states decriminalize an act that is a federal crime?
-
Bud Bunyan opened Bunyan's Supply five years ago. Over the years he has been pleased with its performance, as sales and profits have steadily increased. Recently, however, Bud bas been having...
-
The activities listed in lines 2125 serve primarily as examples of A) Underappreciated dangers B) Intolerable risks C) Medical priorities D) Policy failures
-
The value of 1t can be estimated by: Write a program (using a loop) that determines the expression. Run the program with n = 100, n = 10000, and n = 1000000. Compare the result with pi. (Use format...
-
A round billboard with radius R = 55 in. is designed to have a rectangular picture placed inside a rectangle with sides a and b. The margins between the rectangle and the picture are 10 in. at the...
-
Define the variables a = 3.5, b = -6.4, and then use them to create a row vector that has the following elements: a, a2, a/b, a b, and a.
-
On December 1, 2023, Rebecca Ward, a single taxpayer, comes to you for tax advice. At the end of every year, she donates \($5,000\) to charity. She has no other itemized deductions. This year, she...
-
Kelly and Chanelle Chambers, ages 47 and 45, are married and live at 584 Thoreau Drive, Boston, MA 59483. Kellys Social Security number is 111-11-1111 and Chanelles is 222-22-2222. The Chambers have...
-
Following is a list of information for Peter and Amy Jones for the current tax year. Peter and Amy are married and have three children, Aubrynne, Bryson, and Caden. They live at 100 Main Street,...
Study smarter with the SolutionInn App