Question: Python You can purchase items in an online store on the Internet. You may purchase either as a member or as a guest. If you
Python You can purchase items in an online store on the Internet. You may purchase either as a member or as a guest. If you are a member, you get a 5% member discount on the item purchased. Additionally, you get a 5% discount for Valentine's day. The online retailer sells five products whose retail prices are as follows: Write a program called ItemPrice.py. The main function takes the following from the user as input: product code quantity required code indicating whether or not you are a member Write a function called getProductPrice() that receives the product code and returns the retail price of the product. Use if...elf statement to determine the retail price for each product. Write a function called displayTotaPrice() that receives product quantity, membership indicator, and price and displays final calculated price of the product and the discount received by the user. Assume that all purchases are made on the valentine's day Expected output welcome to the Online Retail Store Enter the product code: 1 Enter the quantity required: 2 Your final price is: exist5.36 Discount earned: 50.62 Sample structure of the program: def main(): #Get user input #call getProduceprice() #cal1 displayTotalPrice() def getProduceprice(product code): return price def displayTotal Price(product quantity, product price, membership indicator) #call main function main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
