BUB in Cash Register project

Hi, fellow code wizards, need your input.

I think I found an error in Cash Register project, the last one from JavaScript Algorithms and Data Structures section. The third test case with 3.26 price and 100 cash (change 96.74), wants output:

change: [
[“TWENTY”, 60],
[“TEN”, 20],
[“FIVE”, 15],
[“ONE”, 1],
[“QUARTER”, 0.5],
[“DIME”, 0.2],
[“PENNY”, 0.04]
]

But my solution provides:

change:
[ [ ‘TWENTY’, 80 ],
[ ‘TEN’, 10 ],
[ ‘FIVE’, 5 ],
[ ‘ONE’, 1 ],
[ ‘QUARTER’, 0.5 ],
[ ‘DIME’, 0.2 ],
[ ‘PENNY’, 0.04 ] ]

Which is also correct, but uses more twenty bills. Can someone fix it?:smiley: I really want to finish this course, what should I do?:slight_smile:

Nevermind, noticed the actual amount of twenty bills is only 60:D

1 Like

Yeah, it is frustrating sometimes, but a big part of being a developer is paying close attention to tiny details.