Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

What are the five stages of the creative process for an individual?

Answered: 1 week ago

Question

Identify five strategies to prevent workplace bullying.

Answered: 1 week ago