Question: PartII: Now Flying Premium Airlines! (20 points) Write a function premiumairlines that takes the following arguments, in this order 1. membership: the string Diamond', 'Platinum,'Regular.

PartII: Now Flying Premium Airlines! (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 If membershipis Platinum and the price is 2000 or more, add 20 to the current points. 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. . If membership isDiamond' 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 membershipis'Diamond' and points is 25 or more, add 2 to the current points In all other cases add 0 to points. 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) adjusting the value of points to the above rules, the function retuns the new value of points. Examples: Your function should be able to return the total points the person has earned (points he has+ whatever he earns) Function Call based on the price of the ticket they have purchased, type of membership, and points they currently have. Return Value remium.airlines Diamond', 4999, 700) 730 premiumairlines 'Rgular,5000, 300 305 Here are the policies: remiumairlines ('Platinum, 500, 1000) 1000 . If membership is either Diamond or Platinum and the price is 5000 or more, add 35 to the current points e If membership is 'Diamond and the price is 2000 or more and points is more than 300, add 30 to the current points. CSE 101-Fall 2017 Lab #4 Page 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
