This calculates the number of years for an initial investment to accumulate (thanks to interest) to a certain amount based on given initial amount, final amount, and interest rate.
A few things I learned from this:
a) When setting up a counter, define an initial value for the counter.
years=0
years += 1
b) Argh! Use decimal format for interest rate. It's much more logical.
c) Check signs (ie greater than versus less than).
No comments:
Post a Comment