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?
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.
…