Computer Science, asked by yograjparmar, 1 year ago

write a programm to find simple interest using scanner

Answers

Answered by meghana6885291
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

meghana6885291: plz mark it to branliest
Answered by sukhpreetkaur18
1
Input

Enter principle: 1200 Enter time: 2 Enter rate: 5.4

Output

Simple Interest = 129.600006
Similar questions