A good answer might be:

With interest paid once at the end of the year you will have $1000 + $1000*0.05 = $1050.

Million Dollar Question

Usually banks pay interest daily or monthly, but for simplicity let us stick with interest paid once per year. At the end of the second year you will have $1050 + $1050*0.05 = $1102.50. Here is what your account looks like at the end of the first several years:

yearInterest for the YearEnd of Year Amount
11000*0.05=501050.00
21050*0.05=52.51102.50
31102.50*0.05=55.1251157.625
41157.625*0.05=57.881251215.50625
51215.50625*0.05=60.775311276.28156
.........

What if you are interested in becoming a millionaire? How long will it take to reach one million dollars? There are formulas for this. (Computer spreadsheets have these formulas built in, as do financial electronic calculators.) But pretend that you don't know that. Here is the outline of a program to calculate how many years it will take:

class MillionDollarYears
{
  public static void main( String[] args )
  {
    double dollars = 1000.00 ;
    int    year = _______________;     

    while ( dollars < 1000000.00 )
    {
      // add another year's interest

      dollars = _______________;

      year    = _______________;
    }

    System.out.println("It took " + year + " years to reach your goal.");
  }

}

The value of the bank account, dollars keeps building up until the goal has been reached or exceeded.

QUESTION 2:

Fill in the blanks to complete the program.