Create a program that will compute the simple interest loans in the bank. The program will ask the user to input the principal amount , the rate per annum and the time (in years).
Given the formula:
Interest = Principal Amount * RateperAnnum * Time / 100
import java.util.Scanner;
class App {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter Principal Amount : ");
double principal = scan.nextDouble();
System.out.print("Enter Rate of Interest : ");
double rate = scan.nextDouble();
System.out.print("Enter Time period in years : ");
int time = scan.nextInt();
double p = (principal * rate * time) / 100;
System.out.println("Payment: " + p);
}
}
Comments
Leave a comment