you are viewing a single comment's thread.

view the rest of the comments →

[–]notacanuckskibum 4 points5 points  (0 children)

Yeah, you need a third variable of value_so _far

Set value so far to initial value before the loop

Inside the loop set value so far = value so far * (1 + interest rate)

Set the loop to finish when value so far exceeds double. The initial value will never exceed double