Prompt the user to input a food item name price and


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 lab.

(1) Prompt the user to input a food item name, price, and quantity. Output an itemized receipt.

Enter food item name: hot dog Enter item price: 2 Enter item quantity: 4 RECEIPT 4 hot dog @ $ 2.0 = $ 8.0 Total cost: $ 8.0

(2) Extend the program to prompt the user for a second item. Output an itemized receipt.

Enter food item name: hot dog Enter item price: 2 Enter item quantity: 4 RECEIPT 4 hot dog @ $ 2.0 = $ 8.0 Total cost: $ 8.0 Enter second food item name: ice cream Enter second item price: 2.50 Enter second item quantity: 3 RECEIPT 4 hot dog @ $ 2.0 = $ 8.0 3 ice cream @ $ 2.5 = $ 7.5 Total cost: $ 13.5

(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.

Enter food item name: hot dog Enter item price: 2 Enter item quantity: 4 RECEIPT 4 hot dog @ $ 2.0 = $ 8.0 Total cost: $ 8.0 Enter second food item name: ice cream Enter second item price: 2.50 Enter second item quantity: 3 RECEIPT 4 hot dog @ $ 2.0 = $ 8.0 3 ice cream @ $ 2.5 = $ 7.5 Total cost: $ 13.5 15% gratuity: $ 2.025 Total with tip: $ 15.525

Any help would be appreciated, it is in Python, been stuck on this for a while. This is the code that was pre-typed:

itemName = input('Enter food item name: \n')

Request for Solution File

Ask an Expert for Answer!!
Database Management System: Prompt the user to input a food item name price and
Reference No:- TGS02876978

Expected delivery within 24 Hours