Project Link:
Cash Register Project
I’ve executed my code in VS Code and get the results required for the project. When I plug it into FBC, though, its not passing the final test. The project says the following:
Test 2:
checkCashRegister(19.5, 20, [[“PENNY”, 1.01], [“NICKEL”, 2.05], [“DIME”, 3.1], [“QUARTER”, 4.25], [“ONE”, 90], [“FIVE”, 55], [“TEN”, 20], [“TWENTY”, 60], [“ONE HUNDRED”, 100]]);should return {status: “OPEN”, change: [[“QUARTER”, 0.5]]}.
. . .
Test 6:
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]]}.
I don’t understand why test 2 requires you to only return what change type is given in the array but the test 6 requires all change types, even ones that aren’t given back. This seems contradictory to me.
My code produces this for test 6:
{status:“CLOSED”, change:[[“PENNY”, 0.5]]}