Build a Cash Register Project - Build a Cash Register

Tell us what’s happening:

In cash Register project, how do cid and price variables reassigned in tests?

Your code so far

<!-- file: index.html -->

/* file: script.js */

/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0

Challenge Information:

Build a Cash Register Project - Build a Cash Register

You know how the top of the file has the two let statements for cid and price?

My guess is that the tests are resetting their values.

So to emulate this, just add lines like:

price = 20.0;
cid = [];

Essentially just make a copy of the variables and put new numbers in and remove the let keywords.
So the first four statements become the first two original lines plus your reassignments after

let price = 1.87;
let cid = [
  ['PENNY', 1.01],
  ['NICKEL', 2.05],
  ['DIME', 3.1],
  ['QUARTER', 4.25],
  ['ONE', 90],
  ['FIVE', 55],
  ['TEN', 20],
  ['TWENTY', 60],
  ['ONE HUNDRED', 100]
];


price = 187; 
cid = [
  ['PENNY', 2.33],
  ['NICKEL', 1.55],
  ['DIME', 1.70],
  ['QUARTER', 5.25],
  ['ONE', 43],
  ['FIVE', 10],
  ['TEN', 40],
  ['TWENTY', 120],
  ['ONE HUNDRED', 200]
];
1 Like