Program to create a non return type method name SI() and print the simple interest and call the method inside the main() method.
Java
import java.util.*;
public class SimpleInterest
{
public void SI()
{
int p=0,r=0,t=0;
double si=0.0;
Scanner sc=new Scanner(System.in);
System.out.print("Enter the Principle: ");
p=sc.nextInt();
System.out.print("Enter the Rate: ");
r=sc.nextInt();
System.out.print("Enter the Time: ");
t=sc.nextInt();
si=(p*r*t)/100;
System.out.println("Simple Interst: "+si);
}
public static void main(String args[])
{
SimpleInterest ob=new SimpleInterest();
ob.SI();
}
}Java