Program to calculate Compound Interest in Java

import java.util.Scanner;

public class CompoundInterest {

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

      double principal = 0;
      double rate = 0;
      double time = 0;

      double compoundInterest = 0;
 
      System.out.print("Enter the Principal amount : ");
      principal = input.nextDouble();

      System.out.print("Enter the Rate : ");
      rate = input.nextDouble();

      System.out.print("Enter the Time : ");
      time = input.nextDouble();

      compoundInterest = principal * Math.pow((1 + rate/100),time);
 
      System.out.println("");
      System.out.println("The Compound Interest is : "
     + compoundInterest);
 
   }


}

Comments

Popular posts from this blog

VirusTotal Lets Apple Fans Play With Fire In The Malware Sandpit

iPhone 5se Design Tipped in New Leak, to Look Like iPhone 5s

Freedom 251 - World's Cheapest Smartphone