Please confirm this Algo.
For Annual Interest Rates:
totalAmmount = (BasicAmmount) x ((InterestRateAnnually)^(NumberOfYears))
or in another algo it may look like this. But they are the same.
for (int i-0; i<NumberOfYears; i++){
basicAmmount = (BasicAmmount) + (BasicAmmount * InterestRateAnnually)}
double CurrMoney=5000,TotalMoney;
int years = 5;
for (int i=0;i<years;i++){
CurrMoney=CurrMoney + (CurrMoney*0.05);
} TotalMoney=CurrMoney;
OR the simplified version
double CurrMoney=5000,TotalMoney;
int years = 5;
TotalMoney=CurrMoney * (1+((0.05)^years));