Hello there! I’m posting this question because I’m seriously stuck understanding the actual question.
The problem states that:
Design a cash register drawer function
checkCashRegister()
that accepts purchase price as the first argument (price
), payment as the second argument (cash
), and cash-in-drawer (cid
) as the third argument.
cid
is a 2D array listing available currency.
and inside the code block, it gives this example
// Example cash-in-drawer array:
// [["PENNY", 1.01],
// ["NICKEL", 2.05],
// ["DIME", 3.1],
// ["QUARTER", 4.25],
// ["ONE", 90],
// ["FIVE", 55],
// ["TEN", 20],
// ["TWENTY", 60],
// ["ONE HUNDRED", 100]]
What I’m not getting is, are those the amounts in each currency? I’d be expecting such an array to contain the number of i.e. pennies. Does, for example, “NICKEL”, 2.05 mean that there’s 2.05$ in nickels alone? Thank you and sorry if this is too trivial!