Java Program to Calculate Simple Interest

Here is a Java program to calculate the simple interest. In this java program to calculate simple interest, we first take amount, duration in year and rate of interest as input from user and use following equation to calculate simple interest.

Simple Interest = (Principle x Rate x Time) / 100

Java program to calculate simple interest


import java.util.Scanner;

class SimpleInterest {
    public static void main(String[] args) {
        double principal, time, rate, SI;

        Scanner scanner = new Scanner(;
        // Taking input from user
        System.out.println("Enter Amount");
        principal = scanner.nextDouble();

        System.out.println("Enter Duration in Years");
        time = scanner.nextDouble();

        System.out.println("Enter Rate of Interest");
        rate = scanner.nextDouble();
        // Calculate Simple Interest
        SI = (principal * time * rate) / 100;

        System.out.format("Simple Interest = %f", SI);
Enter Amount
Enter Duration in Years
Enter Rate of Interest
Simple Interest = 3000.000000

Recommended Posts
Java Program to Calculate Compound Interest
Java Program to Make a Simple Calculator using Switch Statement
Java Program to Convert Fahrenheit to Celsius
Java Program to Convert Celsius to Fahrenheit
Java Program to Print Pascal Triangle
Java Program to Calculate Grade of Students
Java Program to Check If a Year is Leap Year or Not
Java Program to find Area Of Equilateral Triangle
Java Program to Find Surface Area and Volume of Cylinder
Java Program to Convert Decimal to Binary Numbers
Java Program to calculate area and circumference of circle
All Java Programs