Trish at Bargain Swap Shop has decided to add a gift card program for her loyal customers
Question:
Trish at Bargain Swap Shop has decided to add a gift card 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 they buy $50-100, they get a $15 gift card.
- If a customer is in her loyalty program AND they buy over $100, they get a $25 gift card.
- If a customer is not in her loyalty program but they buy over $100, they get a $5 gift card.
Note: Some customers aren't eligible for a gift card. The program should indicate that.
With every purchase, Trish also must charge 6.5% sales tax on the total. The gift card is NOT included in the total and is not considered when calculating the tax.
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 amount of sales tax on the total.
- Calculate the total with tax.
- Output the sales tax and the total with tax. The program should format all money amounts that are output with 2 digits after the decimal point.
- Announce to the user if the customer receives a gift card, and what amount of gift card they receive.
Sample Outputs:
Enter the total purchase amount: 120
Is the customer a loyalty program member (y/n): n
Sales tax: $7.80
Total after tax: $127.80
Gift Card Awarded: $5
Enter the total purchase amount: 95.45
Is the customer a loyalty program member (y/n): y
Sales tax: $6.20
Total after tax: $101.65
Gift Card Awarded: $15
Enter the total purchase amount: 65
Is the customer a loyalty program member (y/n): n
Sales tax: $4.23
Total after tax: $69.22
Gift Card Awarded: $0
International Marketing And Export Management
ISBN: 9781292016924
8th Edition
Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr