Write a Java program to input principle, time and rate (P, T, R) from user and find Simple Interest. How to calculate simple interest in Java programming. Logic to find simple interest in Java program.

**Required knowledge**

Variables and expressions,Arithmetic operators,Basic input/output,Data types

**Simple Interest formula**

Simple interest formula is given by.

Where,

P is the principle amount

T is the time and

R is the rate

**Logic to calculate simple interest**

Step by step descriptive logic to calculate simple interest.

Input principle amount in some variable say principle.

Input time in some variable say time.

Input rate in some variable say rate.

Find simple interest using formula SI = (principle * time * rate) / 100.

Finally, print the resultant value of SI.

**Program to calculate simple interest**

/** * Java program to calculate simple interest */ import java.util.Scanner; class Test { public static void main(String args[]) { float principle, time, rate, SI; Scanner op=new Scanner(System.in); /* Input principle, rate and time */ System.out.print("Enter principle (amount): "); principle=op.nextFloat(); System.out.print("Enter time: "); time=op.nextFloat(); System.out.print("Enter rate: "); rate=op.nextFloat(); /* Calculate simple interest */ SI = (principle * time * rate) / 100; /* Print the resultant value of SI */ System.out.println("Simple Interest = "+SI); } }

**Output:**

Enter principle (amount): 5700 Enter time: 8 Enter rate: 2 Simple Interest = 912.0