View Single Post
Old February 12th, 2007, 09:25 AM     #4 (permalink)
jkrohn
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,553
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
The problem is with the following line:
tempAmount = Interest + tempAmount

Since you never intialize tempAmount the the value of Principle tempAmount is only the amount of accrued interest not the value you think it is. Initiazlie tempAmount to the initial value of principle and it will work fine.

Also there is no reason to eve USE temp amount. Principle is the amount you are incrementing, why not use that as your loop variable?

Jkrohn
__________________
Signatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.
jkrohn is offline   Reply With Quote