Solved

# Compound interest .... !!!

Posted on 2003-12-11

hi everyone, i need help on that question ....

what is the compound interest formula if i'm using 'i' for the rate and 'n' for the numbers of years ???

i already wrote two functions but they're not working !!!!

//============================================

// First one

//========

public float Total(float i,int n) //Savings -> return balance after n years and i interest

{

for(int count=0; count<n; count++)

{

Balance *= Math.pow(( 1 + i ), n);

}

return Balance;

}

//================

// Second one

//========

public float Total(float i,int n) //Savings -> return balance after n years and i interest

{

return Balance *= Math.pow(( 1 + i ), n);

}

//============================

i don't know what one is the correct one .... i'm not a business major :P

and if by any chance ..... could anyone tell me how to do it in the recursive way !!!

thankz