# A man invest sum of money at 5. compound interest for first year ,8.for second year . write a program in java to calculate the amount after three years , takimg sum as input

1
by shalini6

2015-07-25T11:34:07+05:30

### This Is a Certified Answer

Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.
By applying the formula for compound interest in our program which is  where FV is future value, P is principal amount, r is annual rate of interest, but since interest is added as per year we will be using just instead of
(.03 percent is used because 3% keeps increasing)

Code is over here:

/*
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package myexperiment;

/**
*
* @author Lfstone3
*/
import java.util.Scanner;

public class Investment {
public static void main(String args[]){
Scanner scn =new Scanner(System.in);

System.out.println("Enter amount of sum of money:- ");
int cmpdn = scn.nextInt();
System.out.println("compund interest(FV) in 2 yrs:- " + "Rupees "+ Math.pow(cmpdn*1+.03,2));

}

}