Question: Problem 5 Create a new python file with the usual comment header and write code that computes how much a customer has to pay after
Problem 5 Create a new python file with the usual comment header and write code that computes how much a customer has to pay after purchasing two items. Use the variable names item1 and item2 to indicate the two different items. The price is calculated according to the following rules: 1. There is a buy one get one half off promotion. The lower priced item is half price. 2. If the customer is a club card member, they get an additional 10% discount. Use Y to indicate Yes and N to indicate No. You should have a variable that is True if the user has a club card and False otherwise. 3. Tax is added. Use the variable name tax rate to indicate the tax value which will hold the rate as a percentage. For example, the value 8.25 indicates a tax rate of 8.25%. 4. Your code should ask the user for the price of both items they purchased, if they are a club card member, and how much the tax rate is. Your code should return the total price the customer has to pay including tax. Below is a sample execution of the program: Price of Item 1: 10 Price of Item 2: 20 Club Card Member (Y/N): Y Tax: 8.25 Total Price: $24.35625
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
