12/16/2016

Java Program For Calculate Simple Interest

Problem:- Java Program to Find the Simple Interest or Java program to calculate Simple Interest or How to calculate Simple Interest in Java or Java Code for Simple Interest or Java program to calculate Simple Interest with Output and Explanation or Write A Program For Calculate A Simple Interest.

Explanation:- Simple interest program is very popular. For finding a simple interest we need only three input from the user first is amount second rate of interest (yearly) and the third one in time duration. Given formula show that to calculate a simple interest. with the following formula, you have to just put an all these values in given formula and run the program so you can calculate a simple interest of amount given by user input.


Formula for Simple Interest


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


See Also:- C++ Program For Calculate Simple Interest

Java Program For Calculate Simple Interest



import java.util.Scanner;
/* Program By Ghanendra Yadav
   Visit http://www.programmingwithbasics.com
*/
public class SI
{

    public static void main(String args[]) 
    {
        Scanner scanner = new Scanner(System.in);
        float amount,period,rate,si;

        System.err.println("Enter Principle Amount :");
        amount = scanner.nextFloat();
      
        System.err.println("Enter time in years : ");
        period = scanner.nextFloat();
      
        System.out.println("Enter rate annually : ");
        rate = scanner.nextFloat();
      
        si = (amount*period*rate)/100;

        System.out.println("Simple Interested is : " + si);
    }
}


See Also:- C Program For Calculate Simple Interest

Output:-

No comments:

Post a Comment