I have been trying to write a program, but it isn't working! I have to calculate money in dollars, quaters, nickels, dimes and pennies. I've been working on it for more then a week and it just isn't working.
Beginner Help...
Collapse
X
-
I expect it's because you are using floating point (because of the handy decimal) and are suffering from rounding error.
Finance applications shoulod use integers and you should keep your amounts in pennies.
An integer containing 123 can always be display as $1.23 by your display function. You don't need the decimal point at all in the code until you print your data.Comment
Comment