Monday, 22 September 2014

InterestCalculator


public class InterestCalculator {

   
    double principle,intrate,noyear;
   
    public void calculateInterest(double p, double r, double n)
    {
        double interest  = (p*r*n)/100;
        System.out.println("Interest :"+interest);
   
    }
   
    public static void main(String args[])
    {
   
       
        InterestCalculator IC = new InterestCalculator();
        IC.calculateInterest(1000, 12, 1);
        IC.calculateInterest(5000, 12, 1);
        IC.calculateInterest(10000, 12, 1);
        IC.calculateInterest(15000, 12, 1);
        IC.calculateInterest(20000, 12, 1);
        IC.calculateInterest(25000, 12, 1);
       
       
    }
}

No comments:

Post a Comment