#include<iostream.h>
#include<conio.h>
class worker
{
int cno;
public:
void putno(int);
void getno(void);
};
void worker::putno(int c)
{
cno=c;
}
void worker::getno()
{
cout<<"\n Worker Number= "<<cno;
}
class money:public worker
{
public:
int salary,exp;
void putmoney(int,int);
void getmoney(void);
};
void money::putmoney(int s,int e)
{
salary=s;
exp=e;
}
void money::getmoney()
{
cout<<"\n Basic Salary= "<<salary;
cout<<"\n Expence= "<<exp;
}
class month:public money
{
int total;
public:
void display(void);
};
void month::display(void)
{
total=salary-exp;
getno();
getmoney();
cout<<"\n Monthly Salary= "<<total;
}
void main()
{
clrscr();
month t;
t.putno(1);
t.putmoney(5000,1000);
t.display();
getch();
}
#include<conio.h>
class worker
{
int cno;
public:
void putno(int);
void getno(void);
};
void worker::putno(int c)
{
cno=c;
}
void worker::getno()
{
cout<<"\n Worker Number= "<<cno;
}
class money:public worker
{
public:
int salary,exp;
void putmoney(int,int);
void getmoney(void);
};
void money::putmoney(int s,int e)
{
salary=s;
exp=e;
}
void money::getmoney()
{
cout<<"\n Basic Salary= "<<salary;
cout<<"\n Expence= "<<exp;
}
class month:public money
{
int total;
public:
void display(void);
};
void month::display(void)
{
total=salary-exp;
getno();
getmoney();
cout<<"\n Monthly Salary= "<<total;
}
void main()
{
clrscr();
month t;
t.putno(1);
t.putmoney(5000,1000);
t.display();
getch();
}
No comments:
Post a Comment