Calculate simple interest by using concept of class and object

#include
#include
class sint
{
private:
float p,r,t,si;
public:
void dentry();
void calc()
{
si=(p*r*t)/100;
}
void display();
};

void sint::display()
{
cout<<"n Principlettratettimettinterest:";
cout<<"n "<<p<<"ttt"<<r<<"t"<<t<<"tt"<<si;
}

void sint::dentry()
{
clrscr();
cout<>p;
cout<>r;
cout<>t

};

main()
{

class sint x;
x.dentry();
x.calc();
x.display();
getch()
};

Leave a reply