class Interest

{

int p,r;

public void findInterest(int p,int  r)

{

System.out.println("The interest for one year is:"+(p*r/100));

}

public void findInterest(int p,int r,int y)

{

System.out.println("The interest for"+y+"year is:"+(p*r*y/100));

}

}

class Actions extends Interest

{

Interest in;

public Actions()

{

in=new Interest();

in.findInterest(4000,4);

in.findInterest(4000,4,2);

}

public static void main(String args[])

{

new Actions();

}

}

 

Output:


The interest for one year is:160

The interest for2year is:320