Q:

java Program to calculate compound interest

belongs to collection: Simple Formula Based Java Programs

0

java Program to calculate compound interest

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

In this demo I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability..

class CompundInterest {
        public static void main(String args[]) {

        double amount = 0, principle = 1000, rate = 10, time = 3, ci;

        System.out.println("principle= " + principle);

        System.out.println("rate= " + rate);

        System.out.println("time= " + time);

        amount = principle * ((1 + rate / 100) * (1 + rate / 100) * (1 + rate / 100));

        System.out.println("amount= " + amount);

        ci = amount - principle;

        System.out.println("compound interest = " + ci);

         }
}

Result:

principle= 1000.0rate= 10.0

time= 3.0

amount= 1331.0000000000005

compound interest = 331.00000000000045

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Java Program To Calculate Batting Average... >>
<< Java Program To Calculate CGPA Percentage...