# Exact Change Bug?

Exact Change Bug?
0

#1

Hello,

One of the requirements for the “Exact Change” Advanced Algorithm Scripting states

“checkCashRegister(19.50, 20.00, [[“PENNY”, 0.01], [“NICKEL”, 0], [“DIME”, 0], [“QUARTER”, 0], [“ONE”, 1.00], [“FIVE”, 0], [“TEN”, 0], [“TWENTY”, 0], [“ONE HUNDRED”, 0]]) should return “Insufficient Funds”.”

Im confused on why this argument should return “Insufficient Funds.” If price is 19.50 and cash is 20.00, that leaves 00.50 for change back. The cid argument has a total of 1.01 (Penny [0.01] + One [1.00]). Therefore, there is sufficient funds available for change back. Am i missing something?

#2

You have enough money, but it’s not an EXACT change.

Is this what you want to happen?
so customer gives cashier \$20 for \$19.50 purchase
cashier gives customer 1.00 change and asks customer for \$0.50
customer looks at cashier confused, he doesn’t have 50 cents in change but he has \$5.00
so customer gives cashier \$5.00 and asks for \$4.50 change
cashier has enough money in the till, after all he just received a \$20 and \$5 bill and a penny.
so cashier gives \$20 back to customer and asks for \$15.50 change.

#3

I think insufficient funds refers to the cashier. If you only have a dollar and a penny how can you give \$0.50 in change?

#4

Ohhh ok. Thank you very much