Skip to main content
2 of 3
added 469 characters in body
Richard Qiu
  • 207
  • 2
  • 10

You need to subtract the value of the quarter every time the if loop is executed. You also don't really need int leftover. This is what you should try to follow:

do
{
if (change > 25)
{
    do
    {
        //subtract change
        //add a coin
    }
    while (change >= 25);
}

if (//dime value)
{
    do
    {
        //subtract value;
        //add coins;
    }
}
//do same thing for nickels and pennies
}
while (change > 0)
Richard Qiu
  • 207
  • 2
  • 10