DFS :: HYBRID

#include<iostream.h>
#include<conio.h>

class empl
{
int ecode;
public:
emp();
};

empl::emp()
{
ecode=101;
return ecode;
}

class salary :virtual public empl
{
int ecode,bs,hra,net;
public:
sal();
};

salary::sal()
{
cout<<“Enter the basic salary: “;
cin>>bs;
hra=bs*0.1;
net =bs+hra;
// cout<<emp();
cout<<“\nNet Salary:”<<net;
return net;
}

class commission : public virtual empl
{
int ecode,ip,is,com;

public:
comm();
};

commission::comm()
{
cout<<“Enter the no of item sold: “;
cin>>is;
cout<<“Enter the price per unit: “;
cin>>ip;
com=ip*is*0.1;
cout<<“\nCommission:”<<com;
return com;
}
class income : public salary,public commission
{
int inc;
public:
grosssal();
};

income::grosssal()
{
cout<<“Code:”<<emp()<<endl;
inc=sal()+comm();
cout<<“\nIncome : “<<inc;
}
void main()
{
clrscr();
income ob;
ob.grosssal();
getch();
}

Share

About the Author

Akash Padhiyar

Visit Website

There are no comments yet, add one below.

Leave a Comment

Your email address will not be published. Required fields are marked *

*

Time limit is exhausted. Please reload CAPTCHA.