question 83 Functions · easy
Loyalty points for an order
Runtime Market gives loyalty points on every order: one point per whole dollar spent (cents don't count). Members earn double. Any order of 100 dollars or more earns a flat 50 bonus points on top, which is not doubled.
Function
loyalty_points(amount, member)amountthe order total in dollars, a positive number such as
64.47member
True or FalseReturnsthe points as a whole number
Examples
callloyalty_points(64.47, False)returns64
callloyalty_points(64.47, True)returns128
callloyalty_points(150, False)returns200