Write a Java Program to Solve/Calculate of a Simple Interest by given condition. Use Method to solve this issue. Do not use parameter and return value from Method.
Reference:
1. http://c-programming-sourcecode.blogspot.com/2012/07/write-c-program-to-find-simple-interest.html?q=simple+interest
2. Course Book(The Complete Reference Java j2se) ; Page 112
Source Code:
package calculate;
import java.util.Scanner;
class Interest
{
float SI,t,y,r;
void showValue()
{
System.out.println("The result is :" +((t*y*r)/100));
}
}
public class Calculate
{
public static void main(String[] args)
{
Interest i= new Interest();
Scanner inp=new Scanner(System.in);
System.out.print("Enter the value of t,y,r :");
i.t=inp.nextFloat();
i.y=inp.nextFloat();
i.r=inp.nextFloat();
i.showValue();
}
}
Reference:
1. http://c-programming-sourcecode.blogspot.com/2012/07/write-c-program-to-find-simple-interest.html?q=simple+interest
2. Course Book(The Complete Reference Java j2se) ; Page 112
Source Code:
package calculate;
import java.util.Scanner;
class Interest
{
float SI,t,y,r;
void showValue()
{
System.out.println("The result is :" +((t*y*r)/100));
}
}
public class Calculate
{
public static void main(String[] args)
{
Interest i= new Interest();
Scanner inp=new Scanner(System.in);
System.out.print("Enter the value of t,y,r :");
i.t=inp.nextFloat();
i.y=inp.nextFloat();
i.r=inp.nextFloat();
i.showValue();
}
}