Working on the cash register project…
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register
I cannot understand this one:
checkCashRegister(19.5, 20, [[“PENNY”, 0.01], [“NICKEL”, 0], [“DIME”, 0], [“QUARTER”, 0], [“ONE”, 1], [“FIVE”, 0], [“TEN”, 0], [“TWENTY”, 0], [“ONE HUNDRED”, 0]]) should return {status: “INSUFFICIENT_FUNDS”, change: []}.
The first value is the total price… and the second one the cash I’m receiving.
So the change should be 0.5 dollars, right?
The sum of all I’ve in the cash machine is more than one dollar:
[“ONE”, 1] <— just this should be enough!
Why It should return “INSUFFICIENT_FUNDS” ?
I’ve more than a dollar in the cash, and the change is 0.5!
Cannot understand