09. Write a program to calculate simple interest using scanner class.
Please tell
Answers
Answered by
2
Answer:
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.println("Enter the principal: ");
p = s.nextFloat();
System.out.println("Enter the Rate of Interest: ");
r = s.nextFloat();
System.out.println("Enter the Time Period: ");
t = s.nextFloat();
float si;
si = (r * t * p) / 100;
System.out.println("The Simple Interest is: " + si);
}
}
Similar questions