Question: PYTHON PROGRAMMING 13)Write a function cad_cashier(price,payment) that takes two real nonnegative numbers with two decimal places as input, where payment>=price and where the second decimal
PYTHON PROGRAMMING
13)Write a function cad_cashier(price,payment) that takes two real nonnegative numbers with two decimal places as input, where payment>=price and where the second decimal in payment is 0 or 5. They represent a price and payment in Canadian dollars. The function should return a real number with 2 decimal places representing the change the customer should get in Canadian dollars. Recall that in Canada, while the prices are expressed in pennies, the change is based on rounding to the closest 5 cents...
>>> # testing Question 13
>>> >>> cad_cashier(10.58,11)
0.4
>>> cad_cashier(98.87,100)
1.15
>>> cad_cashier(10.58,15)
4.4
>>> cad_cashier(10.55,15)
4.45
>>> cad_cashier(10.54,15)
4.45
>>> cad_cashier(10.52,15)
4.5
>>> cad_cashier(10.50,15)
4.5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
