I'm trying to write a function for calculating compound interest.
Here's my code:
That is supposed to return "100," because with 0 interest for any amount of years, you would stay at the principal. But instead, it just returns "0."
What do I need to change?
Here's my code:
Graphics 800,600 Print CalcCompoundInterest(100,0,15) WaitKey End ;Calculates Compound Interest ;principal, rate, time Function CalcCompoundInterest(p,r#,t) r# = r# For a = 0 To t i = p*r# p = p + i Next End Function
That is supposed to return "100," because with 0 interest for any amount of years, you would stay at the principal. But instead, it just returns "0."
What do I need to change?