Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# print _ receipt # Parameters: original _ total, discount # Return: none # Side effect: prints a summary of the bill and discount savings

# print_receipt
# Parameters: original_total, discount
# Return: none
# Side effect: prints a summary of the bill and discount savings
def print_receipt(original_total, discount):
human_readable_discount = discount;
# TODO 10: Generate the human-readable discount from the discount variable,
# e.g.0.2 should be 20, to print a 20% discount
discount_price = original_total * discount
total = original_total - discount_price
# TODO 11: Fix the formatting of the summary below to print exactly 2 decimal places for each number
# TODO 12: Check the output and make sure that it makes sense. If not, it means there are bugs still in
the code.
print("
")
print("****** CUSTOMER BILL SUMMARY ******")
print("Subtotal: \t\t $, original_total, sep="")
print(human_readable_discount, "% Discount: \t\t -$, discount, sep="")
print("TOTAL AFTER DISCOUNT \t\t $", total, sep="")
print("You Saved ??t??t??t$, discount, sep="")
image text in transcribed

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions