write a programm to find simple interest using scanner
Answers
Answered by
4
Hey good morning :-)
« Prev Page
Next Page »
Java Program to Find the Simple Interest
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.
advertisement
import java.util.Scanner;public class Simple_Interest{ public static void main(String args[]) { float p, r, t; Scanner s = new Scanner(System.in); System.out.print("Enter the Principal : "); p = s.nextFloat(); System.out.print("Enter the Rate of interest : "); r = s.nextFloat(); System.out.print("Enter the Time period : "); t = s.nextFloat(); float si; si = (r * t * p) / 100; System.out.print("The Simple Interest is : " + si)
output
« Prev Page
Next Page »
Java Program to Find the Simple Interest
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.
advertisement
import java.util.Scanner;public class Simple_Interest{ public static void main(String args[]) { float p, r, t; Scanner s = new Scanner(System.in); System.out.print("Enter the Principal : "); p = s.nextFloat(); System.out.print("Enter the Rate of interest : "); r = s.nextFloat(); System.out.print("Enter the Time period : "); t = s.nextFloat(); float si; si = (r * t * p) / 100; System.out.print("The Simple Interest is : " + si)
output
meghana6885291:
plz mark it to branliest
Answered by
1
Input
Enter principle: 1200 Enter time: 2 Enter rate: 5.4
Output
Simple Interest = 129.600006
Enter principle: 1200 Enter time: 2 Enter rate: 5.4
Output
Simple Interest = 129.600006
Similar questions
Business Studies,
6 months ago
Math,
6 months ago
English,
6 months ago
English,
1 year ago
English,
1 year ago