? ? 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
-
Predict the products of the following reactions. (a) Cyclopentyl methyl ketone + excess Cl2 + excess NaOH (b) 1-cyclopentylethanol + excess I2 + excess NaOH (c) Propiophenone + excess Br2 + excess...
-
Match the parametric equations with the graphs (labeled IVI). Give reasons for your choices. x = cos t, y = sin t, z sin 5t I III V of ZA A II x4 IV VI N Z ZA
-
If a large force is applied to an object, does it necessarily follow that work in done on it? \(\bullet\)
-
A perfectly insulated cylinder fitted with a leak proof friction less piston with a mass of 30.0 kg and a face area of 400.0 cm 2 contains 7.0 kg of liquid water and a 3.0-kg bar o1 aluminum. The...
-
23. A convex mirror used for rear view on an automobile has a radius of curvature of 3m. If a bus is located at 5m from this mirror, find the position, nature and magnification of the image. 24. An...
-
New Horizons Co. is a high-tech firm whose owner does not have the required management expertise to run the firm. The owner wants to hire a manager with the required expertise. The continued success...
-
Krapp Technologies Inc. began 2022 with inventory of $20,000. During the year, Krapp purchased inventory costing S100,000 and sold goods for S140,000, with all transactions on account. Krapp ended...
-
What is the purpose of significant figures?
-
Are an equation and an equivalence statement the same? Explain.
-
When you do order-of-magnitude calculations, should you be concerned about significant figures? Explain.
-
Use SI unit analysis to show that the equation for the surface area of a sphere A = 4r2, where A is the area and is the radius of a sphere, is dimensionally correct.
-
Which of the following metric prefixes is the smallest: (a) micro-, (b) centi-, (c) nano-, or (d) milli-?
-
Betsy opens a brokerage account in her name and that of her husband, Jason ( jointly with right of survivorship ) , and makes an initial contribution of $ 1 m to the account. Jason later contributes...
-
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.
-
In a large office building, there is a woman dead in her locked office, sitting at her desk. Except for the desk, chair, and contents on the desk, the office is empty and the air conditioner is...
-
How many birthdays does the average person have?
-
There are 5 different color houses, occupied by people of 5 different nationalities, who smoke 5 different cigar brands, drink 5 different types of alcohol, and have 5 different pets. The houses are...
Study smarter with the SolutionInn App