WAP that asks a user to input prrincipal amount, number of years, and arte of interest This program should display simple interest.
Answers
Answered by
1
Answer:
import java.util.*;
class Interest
{
void main()
{
Scanner sc = new Scanner (System.in);
SOPLN("Enter the principal");
double p = sc.nextDouble();
SOPLN("Enter the time");
double n = sc.nextDouble();
SOPLN("Enter the rate");
double r = sc.nextDouble();
double SI = (p*n*r)/100;
System.out.println("The interest is ₹ "+SI);
}
}
P.S--- SOPLN means System.out.println ok
Similar questions