Best Way To Find Simple Interest In Java

Sharing is healthy !!

You are here to learn the best way to find simple interest in java. Let us understand what is simple interest with an example.

what is simple interest?

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

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

example: Best Way To Find Simple Interest In Java

Also Read – Print Multiplication Tables Of Any Number In Java

import java.util.Scanner;

public class Simple_Interest_In_Java {
 
public static float simple_Interest(float value_Principle, float value_Rate, float value_Time){
 
float cal_Interest = (value_Principle * value_Rate * value_Time) / 100;
return cal_Interest;
 
}

public static void main(String[] args) {
 
Scanner sc = new Scanner(System.in);
System.out.println("Best way to find Simple Interest In Java");
 
System.out.println("Please enter principal amount: ");
float get_Amount = sc.nextFloat();
 
System.out.println("Please enter time(in years): ");
float get_Time = sc.nextFloat();
 
System.out.println("Please enter rate annually: ");
float get_Rate = sc.nextFloat();
 
float get_Interest = simple_Interest(get_Amount, get_Rate, get_Time);
 
System.out.println("Simple Interest is: " + get_Interest);

}
}

Output:

Best Way To Find Simple Interest In Java

Sharing is healthy !!