-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleInterest.java
More file actions
21 lines (14 loc) · 602 Bytes
/
SimpleInterest.java
File metadata and controls
21 lines (14 loc) · 602 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Write a program to input principal, time, and rate (P, T, R) from the user and find Simple Interest.
import java.util.Scanner;
public class SimpleInterest {
public static void main(String[] args) {
float p, t, r, si; // principal amount, time, rate, simple interest respectively
System.out.println("Enter the values for p, t and r");
Scanner input = new Scanner(System.in);
p = input.nextFloat();
t = input.nextFloat();
r = input.nextFloat();
si = (p * r * t) / 100;
System.out.println("Simple Interest is: " + si);
}
}