Computer Science, asked by ayan7456, 1 year ago

write a program to accept the principal amount ,rate and time and display the simple intrest.
By java programming.

Answers

Answered by Rossily
11
This is a Java program to find the simple interest.

Formula:-

Simple interest = (Principal * Rate * Time)/100

Enter the principal, rate of interest and time period as input. Now we use the given formula to calculate the simple interest.

Here is the source code of the Java program to find the simple interest. The Java program is successfully compiled and run on a Windows system. The program output is also shown below:-

1. Import Java.util.scanner;
2. Public class simple_interest
3. {
4. Public static void main(string args
5. {
6. Float p, r, t;
7. Scanner s = new scanner = new scanner ( system)
8. System.out.print ("enter the principal)
9. p = s.next float();
10. System.out.print ("enter the rate)
11. r = s. nextfloat ();
12. System. out . print ("enter the time period)
13. t = s. next float ();
14. float si;
15. si = (r * t * p) / 100;
16. system . out . print ( the simple interest is : " + si)
17. }
18. }
Answered by duragpalsingh
3
Hey there!

Program is as follows:

import java.io.*;
class Interest
{
public static void main (String args []) throws IOException
{ InputStreamReader ir = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader (ir);
System.out.println("Enter principle, rate, time:");
int p = Integer.parseInt(br.readline());
int r = Integer.parseInt(br.readline());
int t = Integer.parseInt(br.readline());
double si = (p*r*t)/100;
System.out.println("The simple interest is " + si);
}
}

Hope It Helps You!
Similar questions