Answer to Question #309720 in Java | JSP | JSF for Djk

Question #309720

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



1
Expert's answer
2022-03-11T07:24:32-0500


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);
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS