Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3 Trish at Bargain Used Books has decided to add a discount program for her loyal customers and for customers that buy a lot.

Problem 3

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 $75 or less, they get a 20% discount.
  • If a customer is in her loyalty program AND they buy over $75, they get a 30% discount.
  • If a customer is not in her loyalty program but they buy over $75, they get a 10% discount.

With every purchase, Trish also must charge 7% 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.
  • 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: 80

Is the customer a loyalty program member (y/n): n

Total after discount: $72.00

Sales tax: $5.04

Total after tax: $77.04

-------------------------------------------------------------------------------------------

Enter the total purchase amount: 90

Is the customer a loyalty program member (y/n): y

Total after discount: $63.00

Sales tax: $4.41

Total after tax: $67.41

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

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions