write a java program to calculate compound interest ( public class)
Answers
Answered by
3
import java.util.Scanner;
public class CI {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Please Enter The Principle Amount");
double P = sc.nexDouble();
System.out.println("Please Enter The Rate %");
double R = sc.nextDouble();
System.out.println("Please Enter The Time Span");
double T = sc.nextDouble();
System.out.println();
double A = P * (Math.pow(1 + (R/100)) , T);
double CI = A - P ;
System.out.println("Compound Interest = "+ CI);
sc.close();
}
}
Similar questions