Pages

Tuesday, July 3, 2012

simple interest program in java

Write a Java program that calculates and prints the simple interest using the formula
Simple Interest = PNR / 100
Input values P,N,R should be accepted as command line input as below.
e.g. java SimpleInterest 5 10 15


class one{
public static void main(String args[])
{
double p,n,r,SI;
p=Double.parseDouble(args[0]);
n=Double.parseDouble(args[1]);
r=Double.parseDouble(args[2]);
SI=(p*n*r)/100;
System.out.println("The simple interese is: "+SI);
}
}

No comments:

Post a Comment