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.
|