Question
Create a Python program (food_receipt.py). This program is based on Prog Assignment 2 - 3: Food receipt by using functions. Include the following functions: (1)
Create a Python program (food_receipt.py). This program is based on Prog Assignment 2 - 3: Food receipt by using functions. Include the following functions:
(1) get_item(): In this function, Prompt the user to input a food item name, price, and quantity. This function will have no parameters and will return the entered values. To return more than one value from a function, you separate the values you want to return by commas. Example:
def get_name(): # your code return first_name, last_name
When you call the function in the main, you separate your variable names by commas. Example:
first_name, last_name = get_name()
(2) print_item(name, price, quantity): In this function, you output an itemized receipt. This function will have three parameters (name, price, quantity) and will print an itemized receipt based on the entered values.
4 rice @ $ 2.3 = $ 9.2
(3) __main__: In the main, call get_items twice, then print the receipt. When printing the receipt, call print_item twice for the items you have. Also output a mandatory 15% gratuity to the total cost. Then output the total cost, the cost of gratuity, and the grand total. (Submit for 4 points)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started