Cash Register Challenge has an erroneous test

My submission for the Cash Register challenge fails for one test and one test only, which gives the following feedback:

checkCashRegister(19.5, 20, [[“PENNY”, 0.5], [“NICKEL”, 0], [“DIME”, 0], [“QUARTER”, 0], [“ONE”, 0], [“FIVE”, 0], [“TEN”, 0], [“TWENTY”, 0], [“ONE HUNDRED”, 0]])

should return

{status: “CLOSED”, change: [[“PENNY”, 0.5], [“NICKEL”, 0], [“DIME”, 0], [“QUARTER”, 0], [“ONE”, 0], [“FIVE”, 0], [“TEN”, 0], [“TWENTY”, 0], [“ONE HUNDRED”, 0]]}

This is obviously not true. The difference 19.5 and 20 is .5, or 50 cents, and the register only has 5 pennies so it should return the insufficient funds message.

0.5 dollars in pennies is 50 cents.

2 Likes

You’re right, completely forgot the input was the amount of money in pennies, not the number of pennies, thanks!

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.