Q:

Java Program For Calculate Simple Interest

0

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;

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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);
    }
}

 

Output:

Enter Principle Amount :

5669.56

Enter time in years : 

3.0

Enter rate annually : 

5.6

Simple Interested is : 952.486

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now