Java program to find simple interest

Hey guys!! Welcome to flower brackets blog. You are here to learn java program to find simple interest. java program to find simple interest

Simple interest enumerate interest on invested amount. It is calculated by,

Also read – print multiplication tables of any number in java

Simple Interest = (P * T * R) / 100

Let’s see java program to calculate simple interest,

import java.util.Scanner;

public class SimpleInterestJavaProgram
{
   public static void main(String[] args) 
   {
      float principal, rate, time;
      Scanner sc = new Scanner(System.in);
      System.out.print("Enter principal amount : ");
      principal = sc.nextFloat();
      System.out.print("Please enter rate annually : ");
      rate = sc.nextFloat();
      System.out.print("Please enter time(in years) : ");
      time = sc.nextFloat();
      float simpleInterest;
      simpleInterest = (principal * time * rate) / 100;
      System.out.print("The Simple Interest is : " + simpleInterest);
      sc.close();
   }
}

Output:

Enter principal amount : 5000
Please enter rate annually : 7
Please enter time(in years) : 2
The Simple Interest is : 700.0

Related Posts