Question: ( CANNOT USE LOOPS OR IF / ELSE STATEMENTS 2 points ) Write a function cad _ cashier ( price , payment ) that takes
CANNOT USE LOOPS OR IFELSE STATEMENTS points Write a function cadcashierpricepayment that takes two real nonnegative numbers
with two decimal places as input, where paymentprice and where the second decimal in
payment is or They represent a price and payment in Canadian dollars. The function should
return a real number with 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 cents. See the examples in Section for clarification and
examples on how your function must behave.
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 minCADcoinspricepayment that returns five numbers 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 cadcashier function, from question 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
