belongs to collection: Simple Formula Based Java Programs
java Program to calculate compound interest
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
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
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..
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