Tell us what’s happening:
I am not understanding the meaning of this line
Otherwise, return {status: "OPEN", change: [...]}
, with the change due in coins and bills, sorted in highest to lowest order, as the value of the change
key.
If the amount given back is 0.5 (20 - 19.5), that can be paid using penny, nickel or dime …
why the answer is 0.5 quarter.
we can pay the 0.5 using 100 nickel it will sum to 0.5 i.e 100 * 0.05 = 0.5
plzz help
Your code so far
function checkCashRegister(price, cash, cid) {
var change;
// Here is your change, ma'am.
return change;
}
// 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]]
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]]);
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36
.
Link to the challenge: