Question: Write a function premium airlines() that takes the following arguments, in this order: Solve the problem by using python Part II: Now Flying Premium Ailines!

Write a function premium airlines() that takes the following arguments, in this order:

 Write a function premium airlines() that takes the following arguments, in
Solve the problem by using python

Part II: Now Flying Premium Ailines! (20 points) 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 positive 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 purchase. In a situation where customer satisfies more than one criteria, the company only gives points for the criteria that awards the customers the most points and ignores everything else they qualify for 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 membershipis Diamond' and the price is 2000 or more and points is more than 300, add 30 to the current points. e If membership is 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 membership is 'Regular' and the price is 5000 or more, add 5 to the current points. If membership is Diamond' and points is 25 or more, add 2 to the current points. In all other cases add 0 to points. . e . After adjusting the value of points to the above rules, the function returns the new value of points. Examples: Function Call Return Value remium airlines(Diamond,4999, 700) 730 premium-airlines ('Regular,5000,300)305 premium airlines ('Platinum',500,1000) 1000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!