Answered step by step
Verified Expert Solution
Question
1 Approved Answer
# print _ receipt # Parameters: original _ total, discount # Return: none # Side effect: prints a summary of the bill and discount savings
# printreceipt
# Parameters: originaltotal, discount
# Return: none
# Side effect: prints a summary of the bill and discount savings
def printreceiptoriginaltotal, discount:
humanreadablediscount discount;
# TODO : Generate the humanreadable discount from the discount variable,
# eg should be to print a discount
discountprice originaltotal discount
total originaltotal discountprice
# TODO : Fix the formatting of the summary below to print exactly decimal places for each number
# TODO : 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
printSubtotal: tt $ originaltotal, sep
printhumanreadablediscount, Discount: tt $ discount, sep
printTOTAL AFTER DISCOUNT tt $ total, sep
printYou Saved $ discount, sep
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