Wednesday, January 01, 2014

Complicated investments!



The interest on education loans or home loans is compounded by banks every year at 9-10%.  But, the returns we get on our investments may not be compounded in the same way in plans like some endowment policies or ULIPs. Here's a word of caution while trying to choose your investment plan. I created this java utility class to calculate the final amount I get in one of my investment plans - 198405, when I invested 24000 every year for 7 years compounded at the rate of 5.5%. To check this fact, just replace the 5.5 with 10. There's a difference of ~23000, which is almost an year's investment!
  
/**
In the interest of public
@Author yoursTruly
*/

public class UlipInterest {

    public double sumInUnitDuration(double principal, double rate){

    return principal * (1 + rate/100);

    }

    public double totalAfterUlipDuration (int duration, double principal, double rate) {
        double tempSum=0.0;
        double tempPrincipal= 0.0;
        double totalSum = 0.0;
            for(int i=0; i
            if(i==0){
            tempPrincipal = 0;
            } else {
            tempPrincipal = sumInUnitDuration(tempSum, rate);
            }
           
            tempSum = principal + tempPrincipal;
            //totalSum += tempSum;
            }
            return tempSum;
    }
   
    public static void main(String args[]){
           UlipInterest uInt = new UlipInterest();
           System.out.println(uInt.totalAfterUlipDuration(7,24000,5.5));
    }

}


Comes handy if you want to check if the interest on your investment is matching your interests!

No comments: