Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python 3 Write a function premiumairlines) that takes the following arguments, in this order: 1. membership: the string 'Diamond', Platinum'. 'Regular'. Any other string is
Python 3
Write a function premiumairlines) that takes the following arguments, in this order: 1. membership: the string 'Diamond', Platinum'. 'Regular'. Any other string is considered invalid input. 2. price: a positive integer that represents the price of a plane ticket 3. points: a posiive integer that represents the number of points earned in the airline rewards program The Premium Airlines company wants to increase its sales and wants to reward customers based on: their mem bership, price they have paid for their ticket, and points they have accumulated by flying with Premium Airlines. You are tasked to create a system that rewards customers accordingly. Since the company is generous, it wants to give its customers as many points as possible per purch criteria, the company only gives points for the criteria that awards the customers the most points and ignores everything else they qualify for ase. In a situation where customer satisfies more than one For Example If the membership is Diamond, price is 5000 and points is 30. The function returns 65 Total points (65) Current points (30) + Points awarded (35) Your function should be able to return the total points the person has earned (points he has + whatever he earns) based on the price of the ticket they have purchased, type of membership, and points they currently have. Here are the policies: . If membership is either Diamond or 'Platinum and the price is 5000 or more, add 35 to the current points . If membership is Diamond' and the price is 2000 or more and points is more than 300, add 30 to the current points . If membershipis Platinum and the price is 2000 or more, add 20 to the current points . If membership is Diamond' and the price is 500 or more and points is 100 or more, add 10 to the current points If membershipis Regular' and the price is 5000 or more, add 5 to the current points If membershipis Diamond' and points is 25 or more, add 2 to the current points In all other cases add 0 to points After adjusting the value of points to the above rules, the function returns the new value of points Examples: Function Call premium-airlines 'Diamond, 4999, 700) 730 premium.airlines 'Regular, 5000, 300) 305 premium airlines 'Platinum, 500, 1000) 1000 Return ValueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started