Question: ( CANNOT USE LOOPS OR IF / ELSE STATEMENTS 2 points ) Write a function cad _ cashier ( price , payment ) that takes

(CANNOT USE LOOPS OR IF/ELSE STATEMENTS 2 points) Write a function cad_cashier(price,payment) that takes two real non-negative 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. See the examples in Section 2 for clarification and
examples on how your function must behave.
(5 points) Suppose that a cashier in Canada owes a customer some change and that the cashier
only has coins ie. toonies, loonies, quarters, dimes, and nickels. Write a function that determines
the minimum number of coins that the cashier can return. In particular, write
a function min_CAD_coins(price,payment) that returns five numbers (t,l,q,d,n) that represent
the smallest number of coins (toonies, loonies, quarters, dimes, and nickels) that add up to
the amount owed to the customer (here price and payment are defined as in the previous
question). You program must first call cad_cashier function, from question 13, to determine the
amount of change that needs to be returned. Then before doing anything else, you may want to
convert this amount entirely to cents (that should be of type int). Once you have the total
number of cents here are some hints on how to find the minimum number of coins.
( CANNOT USE LOOPS OR IF / ELSE STATEMENTS 2

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 Programming Questions!