domesticated om
12-19-05, 09:30 AM
I'm in the process of writing a program in visual basic that takes a Dollar amount, and converts it into breakdowns of change (quarters, nickels, pennies, etc).
I have already successfully created a code for tranlating specific dollar amounts into *one* type of change (IE- shows how many quarters/pennies/nickels it takes to equal the input amount rounded down). Now I want to make it show the amount of change using the least amount of coins.
Example-- If I input "$1.67", then it will produce a result of 1 dollar bill, 2 quarters (I'm not using 50 cent coins), a dime, a nickel, and 2 pennies.
MY question- any idea of how I would do this?
BTW- I'm not looking for help with VB, I just want to know iwhat potential equations would look like for doing this.
Thanks in advance.
I have already successfully created a code for tranlating specific dollar amounts into *one* type of change (IE- shows how many quarters/pennies/nickels it takes to equal the input amount rounded down). Now I want to make it show the amount of change using the least amount of coins.
Example-- If I input "$1.67", then it will produce a result of 1 dollar bill, 2 quarters (I'm not using 50 cent coins), a dime, a nickel, and 2 pennies.
MY question- any idea of how I would do this?
BTW- I'm not looking for help with VB, I just want to know iwhat potential equations would look like for doing this.
Thanks in advance.