Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions

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



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  FV= P(1+ \frac{r}{n} )^{yrs} 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 r instead of  \frac{r}{n}
(.03 percent is used because 3% keeps increasing)

Code is over here:

 * To change this license header, choose License Headers in Project Properties.
 * 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));

0 0 0
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts