The exact change challenge has a wrong test in my view.
They say the following:
case:
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".
When the parameters are function checkCashRegister(price, cash, cid)
, where cid is the money in the drawer, so cid
has a total of $1.01, and the change is $0.50 there is sufficient funds in the drawer!