With interest paid once at the end of the year you will have $1000 + $1000*0.05 = $1050.
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:
year | Interest for the Year | End of Year Amount |
---|---|---|
1 | 1000*0.05=50 | 1050.00 |
2 | 1050*0.05=52.5 | 1102.50 |
3 | 1102.50*0.05=55.125 | 1157.625 |
4 | 1157.625*0.05=57.88125 | 1215.50625 |
5 | 1215.50625*0.05=60.77531 | 1276.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.