No matter what I put in for cost of item change comes back as zero?
Is there a way to see what value is being passed from first set of code to the second? I have tried multiple things but none seem to work.
Please enter the cost of the item purchasing: 61
The cost of the item you entered is: 0.61
The amount of taxed owed on item is: 0.04575
The total amount you owe is: 0.66
Quarters: 0
Dimes: 0
Nickels: 0
Pennies: 0
With above cost should get back
Quarter 1
Dime 1
Nickel 0
Pennies 4
The +0.5 is ensuring rounding to the nearest integer once you assign a double to an int. A simple cast - or just a straight assignment - would truncate down. e.g. 33.999 would truncate to a not-very-close 33.
I'm guessing that your change is from 100. You never state it.
Oh, and I don't know much about American coinage - I'm from the other side of the pond.