Difficulty solving the Cash Register project

PLEASE I NEED SOMEONE TO EXPLAIN THIS CHALLENGE BETTER TO ME.
I am finding it difficult to write any code because I don’t really understand the challenge yet. Please someone help by explaining better. Thanks

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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36.

Challenge: Cash Register

Link to the challenge:

Take a look at the test cases and try to relate them with what you just read in the instructions. Try to solve the problems by drawing out on the paper too. That’s what usually helps me.

1 Like