0

I wanted to write a simple formula in TI-Basic to calculate compound interest for my TI-84 calculator. The formula for compound interest is A = P(1+(r/n))^(n)(t) where p is the principal amount, r is the interest rate (expressed as a decimal), n is the number of times the principal is compounded, t is the amount of time, and a is your final amount with interest added.

When I set variables (see below) and and type the formula in exactly how it is above on my calculators home screen, I get $7332.86, which is the correct answer.

However, when I set the variables and type the formula in as a program (see below), I get $42684.69, which is not correct.

I have tried this program on 2 different TI-84 calculators and I have gotten the same results, so it is not something with my calculator.

I am honestly stumped. I have no idea why this is happening, so if you are good at math, know how to program a ti series calculator, or just see a mistake that I am missing, please tell me because this thing has been driving me crazy!

Program with same inputs and formula but gives different answer than when used on the home screen:

: 2000 -> P
: 0.065 -> R
: 54 -> N
: 20 -> T
: P(1+(R/N))^(N)(T) -> A
: Disp A
AstroCB
  • 12,337
  • 20
  • 57
  • 73
ab217
  • 16,900
  • 25
  • 74
  • 92

3 Answers3

2

I don't exactly know what the problem you are facing is, but I think your program should look like this:

Prompt P
Prompt R
Prompt N
Prompt T

Disp P(1+(R/N))^(NT)

EDIT

I think you need an extra set of parentheses. ^(N)(T) only raises to the power of N, and then multiplies by T. Try ^((N)(T)) or simply ^(NT).

Marlon
  • 19,924
  • 12
  • 70
  • 101
1

You're formula is equivalent to T*P*((1+(R/N))^(N)), which is obviously wrong. The reason it's doing this is because of the order of operations. Try P*(1+(R/N))^(T*N)

helloworld922
  • 10,801
  • 5
  • 48
  • 85
0

A shorter version of the code (if you want to conserve memory space):

:promptP,R,N,T

:Disp P(1+(R/N))^(NT)

Happy coding!

Dave Coffman
  • 231
  • 3
  • 10