Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

computer programming PROBLEM 3 Trish at Bargain Swap Shop has decided to add a gift card program for her loyal customers and for customers that

computer programming PROBLEM 3
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 arent 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.23
Gift Card Awarded: $0
Run this program using the PyCharm Terminal. Take a screenshot of the Terminal that includes the line showing where you started the program run with the results. Name the screenshot Lab02P3-ouput.jpg.

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

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

More Books

Students also viewed these Databases questions