Write a program to find the simple interest of given principle,rate and time
Answers
The program is created in Java:
/*
Date Created: 09-02-2021
Date Edited Last Time: ---NIL---
Question Link: https://brainly.in/question/34868800
Question: Write a program to find the simple interest of given principle, rate and time.
Program Created By: atrs7391
Programming Language: Java
Language version (When program created or last edited): jdk-15.0.2
*/
package Brainly_Answers;
import java.util.Scanner;
public class Simple_Interest_2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter Principle amount: ");
double p = sc.nextDouble();
// p means Principle amount
System.out.println("Enter Rate of Interest per year: ");
double r = sc.nextDouble();
//r means Rate of Interest per year
System.out.println("Enter Time in years: ");
double t = sc.nextDouble();
//t means Time in years
double si = (p*r*t)/100;
//si means Simple Interest
double fa = p+si;
//fa means Final Amount
System.out.println("Simple Interest on the principle amount: "+si);
System.out.println("Final amount after adding the principle to the S.I.: "+fa);
}
}