Please I need explanation on how the cash register problem actually works. I’ve looked at the instructions and some of the test cases but I can’t get my head around them.

Thanks in advance.

Here is the challenge link Cash Register

Can you be a little more specific about which part of the instructions you do not understand?

I’ve not understood how to calculate the change and what the numbers (eg [‘ONE’, 50]) means.

That means there are 50 ONEs.

So whats the meaning of 1.01 Penny, Is the total sum of Penny’s is 1.01

From my understanding [“Penny”, 1.01] means : 1.01 dollars in pennies (101 pennies).

First dimension of the array is what type of currency (bill/coins),

Second dimension of the array is what dollar value in that currency.

[“One”, 50] means 50 dollars in one dollar bills.

I hope it helps happy coding!

2 Likes