# Cash Register - Javascript

how can I give 0.5 in change. I dont think I can.

let change;

change = cash - price;
console.log(change);

I am getting this output:
0.5
0.5
0.5
96.74
0.5
0.5
0.5
0.5

try to think about what you would do if you had a real cash register in front of you.
And you need to give back 0.5 of a dollar (which is 50 cents).

You would check you register to see what denominations of coins you have.
For eg. if you have 0 pennies, 0 nickels, 0 dimes and 0 quarters, then you cannot give the customer back any change because you don’t have small enough denominations.

But if you have 50 pennies, you can give 50 pennies back.
Or if you have 2 quarters, then you can give 2 quarters back.
Or if you have 1 quarter and 2 dimes and 1 nickel, then that works also.

1. what does [“PENNY”, 1.01] mean?
2. what does [“NICKEL”, 2.05] mean?
3. what does [“QUARTER”, 4.25], [“ONE”, 90], [“FIVE”, 55], [“TEN”, 20], mean?

I just dont understand these.

these amounts represent the total amount in \$ of money in the given denomination.
So for:
[“PENNY”, 1.01]
It means there are 101 pennies in the drawer

[“NICKEL”, 2.05]
means there are 41 nickels (41 x 5 = 205 cents)

[“QUARTER”, 4.25], [“ONE”, 90], [“FIVE”, 55], [“TEN”, 20],
This one means the drawer has 17 quarters, 90 dollar bills, 11 five dollar bills and 2 ten dollar bills.

This task is just too advanced for beginners. I won’t be able to complete it.
I was really looking forward to completing the javascript Data Structures but its just too much and too complicated. We are still beginners not advanced coders.

I give up

Thank you for trying to help

I am sorry to hear that.