Cash Register - um... what?

Cash Register - um... what?
0.0 0

#1

Hi Everyone!
So I’m trying to complete the Cash Register challenge but tbh I don’t understand what I have to do:
each element in the cid array is an array of two elements: the currency unit, namely pennies, nickels, etc. and a number. What is that number supposed to represent? The amount fo nickels, pennies, etc, or the amount in dollars that we have in nickels, pennies, etc?
I’m asking because we are provided with a sort of conversion list from nickles, pennies, etc. to dollars and I’m not sure what the point of that is.
Anyway, I’m suer confused! If anyone can clarify what it is exactly that those elements in the array represent, I’d be super grateful!
Cheers.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register


#2

The cash-in-drawer array includes the amount in each currency unit. So, [“NICKEL”, 2.05] means that there are 2.05 dollars in nickels (basically 41 nickels) in the cash-in drawer. Consequently, you need to keep in mind how much of each you have in cash when you calculate the change.


#3

thank you!! that makes sense :slight_smile:


#4

I had the same thing, I was thinking huh?! But it actually really helps that the units show the total amount of money and not the number of the units :slight_smile: ! I have just finished it, took me a a couple of hours of figuring out, so good luck! One tip: with the new website, the console.log does not seem to be working. I solved mine in an IDE on my laptop using console.log for debugging.


#5

thanks!!! yeah I can already foresee it’s going to take me a couple hours :joy::joy:


#6

FYI, for some reason it logs to the developer console now instead of the FCC console. So you can still debug on FCC if you have the developer console open at the same time (Ctrl + Shift + J in Chrome).