Cash Register Project - Clarification needed

I don’t understand what the Cash Register project is asking for.

Am I right in thinking that the strings in the cid 2D array represent the denomination and the the integers/floats represent the quantity of each denomination?

Here’s an example.

For the test case

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]]}

Why does it return the following?

{status: "OPEN", change: [["QUARTER", 0.5]]}

Shouldn’t it be the following?

{status: "OPEN", change: [["QUARTER", 2.0]]}

We’re supposed to find change for $0.5, so that’s equivalent to 2 quarters rather than half a quarter.

Challenge: Cash Register

Link to the challenge:

It’s amount in dollars in specific denomination. So ["QUARTER", 0.5] is $0.5 in quarters.

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