Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

So I need to make a Java program to get the exact change from a specific dollar

ID: 3620323 • Letter: S

Question

So I need to make a Java program to get the exact change from a specific dollar amount inputed by the user.
Here is an example:
$4.23 is 3 cents,
0 nickels, 2 dimes,
0 quarters, 4 dollars,
0 fives, 0 tens,
0 twenties, 0 fifties,
and 0 hundreds.
I know how to start the code but I'm just not sure about the math behind it. For instance I know first, to convert it to cents by multiplying by 100, and you can get the number of 100's by dividing by 10000, but then when it gets to 50's that theory fails.
Any help is appreciated.
Thanks

Explanation / Answer

please rate - thanks
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote