Question: Question 6. (5 points) Part I. Write a function ead, cashier that takes two real non- negative numbers with two decimal places as input, where

 Question 6. (5 points) Part I. Write a function ead, cashier
that takes two real non- negative numbers with two decimal places as

Question 6. (5 points) Part I. Write a function ead, cashier 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. 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. Partll Write a function that determines the minimum number of coins that the cashier can return. In particular, write a function min CAD coins that returns five numbers (t,1,q,d,n) that represent the smal est 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 part). You program must first call cad cashier function, from part I, 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). Question 6. (5 points) Part I. Write a function cad cashier 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. 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. Partll Write a function that determines the minimum number of coins that the cashier can return. In particular, write a function min CADA COns that returns five numbers (t,1,9,d,n) that represent the smal est 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 part). You program must first call cad_cashier function, from part I, 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)

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