Simple interest program using java
Simple Interest is the convenient method used in banking and economic sectors to calculate the interest charges on loans.It gets estimated day to day with the help of some mathematical terms.
Q) write a program to calculate simple interest.
Simple Interest is the convenient method used in banking and economic sectors to calculate the interest charges on loans.It gets estimated day to day with the help of some mathematical terms.
Q) write a program to calculate simple interest.
Code:
import java.util.Scanner;
public class JavaExample
{
public static void main(String args[])
{
float p, r, t, sinterest;
Scanner scan = new Scanner(System.in);
System.out.print("Enter the Principal : ");
p = scan.nextFloat();
System.out.print("Enter the Rate : ");
r = scan.nextFloat();
System.out.print("Enter the Time: ");
t = scan.nextFloat();
scan.close();
sinterest = (p * r * t) / 100; System.out.print("Simple Interest is: " +sinterest);
}
}
Output:-
Enter the Principal : 20
Enter the Rate : 2
Enter the Time: 2
Simple Interest is: 0.8
Other related post:-
Shutdown someone pc using notepad trick
Let window speak to you
Create quiz game using notepad
Program to check planidrome
Find factorial using program
Program to check leap year
Program to sort an array
Program to multiply two matrixes
Program to find root of quadratic equations
Array coding interview questions
Program creating basic calculator
Program to convert Fahrenheit to Celsius or Celsius to Fahrenheit
Program to implement distance formula
Top featured feeds
Top pattern problems
Array coding interview questions
0 Comments
if you have any doubt let me know in comment