Skip to main content
added 54 characters in body
Source Link
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 >is 25more than a quarter)
{
    do
    {
        //subtract change
        //add a coin
    }
    while (change >= 25);
}

if (//dime value)
{
    do
    {
        //subtract value;
        //add coins;
    }
    while(//change is between dime and quarter);
}
//do same thing for nickels and pennies
}
while (change > 0)

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)

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 is more than a quarter)
{
    do
    {
        //subtract change
        //add a coin
    }
    while (change >= 25);
}

if (//dime value)
{
    do
    {
        //subtract value;
        //add coins;
    }
    while(//change is between dime and quarter);
}
//do same thing for nickels and pennies
}
while (change > 0)
added 469 characters in body
Source Link
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)

You need to subtract the value of the quarter every time the if loop is executed

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)
Source Link
Richard Qiu
  • 207
  • 2
  • 10

You need to subtract the value of the quarter every time the if loop is executed