Several ways to do it. I wouldn't overuse floating point maths. I much prefer integer maths for something like this. Amount has to be floating point, but do doubles seem sensible for number of dollars, half dollars etc? What does 0.3 of a half dollar look like?

Send in say 7.73 to the convert function.
Step one convert that to a number of cents? ( *100 )
773 cents.
dollars is simple number of cents / 100 which in integer division returns 7.
subtract number of dollars * 100 from number of cents.
73 cents left.
half dollars is number of cents / 50 which returns 1 in integer division.
subtract number of half dollars * 50 from number of cents
23 cents left.
And so on.

That's one way to do it.