Provident fund and Simple java program to calculate it.

 

A provident fund is an investment fund that is jointly established by the employer and employee to serve as a long term savings to support an employee upon retirement.

CODE:-

In java programming language.

public class Main

{

public static void main(String[] args) {

    int r=12;                           //Rate of interest

    int p=24000;                     //The amount paid yearly

    for(int i=1; i<=35; i++)   // created loop to calculate compounding for 35 year

    {

        int interest=p*r/100;    //interest

        p=p+interest;             //Total amount

        System.out.println("The amout after "+i+" = "+ p);

        p=p+24000;              //The amount in next year

    }

    System.out.println("  *****************    ***************   ****************  ************   ");

System.out.println("The total amount after 35 years= "+p);//Total amount to paid

}

}

OUTPUT:-




Comments

Popular posts from this blog

Tips to improve Coding Skill