Trish at Bargain Used Books has decided to add a discount program for her loyal customers and
Question:
Trish at Bargain Used Books has decided to add a discount program for her loyal customers and for customers that buy a lot. Here's how it works:
- If a customer is in her loyalty program and buy $100 or less, they get a 15% discount.
- If a customer is in her loyalty program AND they buy over $100, they get a 25% discount.
- If a customer is not in her loyalty program but they buy over $100, they get a 5% discount.
NOTE: Some customers aren't eligible for discounts, and the program must account for that.
With every purchase, Trish also must charge 6% sales tax on the total AFTER any discount.
Create a file named Lab02P3.py. Write a program that calculates the cost for the total purchase:
- Ask the user to enter the total purchase amount. NOTE: This number could be a floating point number.
- Ask the user if the customer is in the loyalty program (see sample output).
- Calculate the total after discounts
- Calculate the amount of sales tax on the total.
- Calculate the total after discounts and tax.
- Output the total after discounts, the sales tax, and the total after discounts and tax. The program should format all money amounts that are output with 2 digits after the decimal point.
Sample Outputs:
Enter the total purchase amount: 120
Is the customer a loyalty program member (y/n): n
Total after discount: $114.00
Sales tax: $6.84
Total after tax: $120.84
Enter the total purchase amount: 90
Is the customer a loyalty program member (y/n): y
Total after discount: $76.50
Sales tax: $4.59
Total after tax: $81.09
Modern Systems Analysis And Design
ISBN: 9780134204925
8th Edition
Authors: Joseph Valacich, Joey George