Friday, 16 December 2016

Java Program For Calculate Simple Interest

Problem :- Write A Program For Calculate A Simple Interest .Given Formula Show that to Calculate a Simple Interest .With the following formula you can can calculate a Simple Interest Of Amount Given By User Input 

Formula :-

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

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

Solution :-

/* Program By Ghanendra Yadav
   Visit http://www.programmingwithbasics.com/
*/
import java.util.Scanner;
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:-


Java Program For Calculate Simple Interest

No comments:
Write comments

Recommended Posts × +