Project: Cash Register

Tell us what’s happening:

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/75.0.3770.100 Safari/537.36.

Link to the challenge:

Hello EveryBody,
I don’t understand very well this problem. I want to know
what does the purchase price and payment represent.

price is the cost in dollar of a purchase, cash is the money the customer pay with, cid is the money available in the register

The algorithm should evaluate how much change the customer should receive, and in which denominations (depending on availability of the register), the money left in the register and the register status (OPEN, CLOSEDor INSUFFICENT_FUNDS or something similar)

1 Like

Ok, Thank’s ieahleen for your answer