class Cintrest
{
double p,r,n;
double ci;
Cintrest(double p1,double r1,double n1)
{
p = p1;
r = r1;
n = n1;
}
double calculate_intrest()
{
ci = p * (Math.pow((1+ (r/100)),n));
return ci;
}
}
class Program9
{
public static void main(String args[])
{
double p=5000,r=6.5,n=5;
Cintrest obj = new Cintrest(p,r,n);
System.out.println("compound intrest: " + obj.calculate_intrest());
}
}
No comments:
Post a Comment