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
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
The question asks you to create a Python program that calculates the cost of a total purchase based on certain conditions It involves applying discounts for loyal customers and customers who spend ove...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