Simple interest java program

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

Simple interest is a method to enumerate interest on invested amount or loan. It is calculated by multiplying principal amount, rate and time.

Also read – print multiplication tables of any number in java

Simple Interest = (Principal Amount * Rate * Time) / 100

Let’s see java program to find the 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 = (rate * time * principal) / 100;
      System.out.print("The Simple Interest is : " + simpleInterest);
      sc.close();
   }
}

Output:

Enter principal amount : 500000
Please enter rate annually : 2.5
Please enter time(in years) : 3
The Simple Interest is : 37500.0


Related Posts