Question: Write a program that reads the following, in this order: - membership: the string Diamond, Platinum, Regular. Any other string is considered invalid input. -


Write a program that reads the following, in this order: - membership: the string "Diamond", "Platinum", "Regular". Any other string is considered invalid input. - price: a positive integer that represents the price of a plane ticket. - 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 membership, 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 a 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 passenger gets 65 Total points (65)= Current points (30)+ Points awarded (35) Your program should be able to print the total points the person has earned (points they have + whatever they earn) 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 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. After adjusting the value of points to the above rules, the program prints the new value of points
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
