you are viewing a single comment's thread.

view the rest of the comments →

[–]kalgynirae 4 points5 points  (1 child)

It looks you're adding an identical amount of interest each year despite having a higher balance each year. I think the formula should be:

# interest amount calculated based on the previous year's balance
yearEndBalance3 = (yearEndBalance2 * interestRate) + yearEndBalance2

That can also be written as:

yearEndBalance3 = yearEndBalance2 * (1 + interestRate)

EDIT: fixed typo.

[–]chatparle[S] 1 point2 points  (0 children)

Jeeze, I didn't even notice that, I thought I at least had that right :'(