BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/)
-   BsCS 3rd Semester (http://bzupages.com/240-bscs-3rd-semester/)
-   -   write a program to input visiting and perment employee record by insertion extertion (http://bzupages.com/f240/write-program-input-visiting-perment-employee-record-insertion-extertion-1194/)

arslanbadar 06-11-2008 07:25 PM

write a program to input visiting and perment employee record by insertion extertion
 
Code:

#include
#include
using namespace std;
class employee
{
public:
int id;
string name;
void setdata(int id0,string name0)
{
id=id0;
name=name0;
}
int getid()
{
return id;
}
string getname()
{
return name;
}
};
class eperment : public employee
{
public:
int sal,allow;
void setsal(int sal0)
{
sal=sal0;
}
void setallow(int allow0)
{
allow=allow0;
}
int getsal()
{
return sal;
}
int getallow()
{
return allow;
}
friend istream& operator >>(istream& is,eperment &a)
{
cout<<"Enter the id: ";
is>>a.id;
cout<<"Enter the name: ";
is>>a.name;
cout<<"Enter the sal: ";
is>>a.sal;
cout<<"Enter the allowances: ";
is>>a.allow;
return is;
}
friend ostream& operator <<(ostream& os,eperment &a)
{
cout< os< cout< os< cout< os< cout< os< cout<<"Net Basic sal";
os< cout< return os;
}
};
class evisit : public employee
{
public:
int hours,rph;
void setdata(int hours0,int rph0)
{
hours=hours0;
rph=rph0;
}
int gethours()
{
return hours;
}
int getrph()
{
return rph;
}
friend istream& operator >>(istream& is,evisit &b)
{
 
cout<<"Enter the id: ";
is>>b.id;
cout<<"Enter the name: ";
is>>b.name;
cout<<"Enter the hours: ";
is>>b.hours;
cout<<"Enter the Rate per hour: ";
is>>b.rph;
return is;
}
friend ostream& operator <<(ostream& os,evisit &b)
{
cout< os< cout< os< cout< os< cout< os< cout< os< cout< return os;
}
};
int main()
{
eperment a[2];
evisit b[2];
int i;
cout<<"Enter the perment emp data"< for(i=0;i<2;i++)
{
cin>>a[i];
}
cout<<"Enter the visiting emp data"< for(i=0;i<2;i++)
{
cin>>b[i];
}
int loc=0;
int large =a[0].sal+a[0].allow;
for(i=0;i<2;i++)
{
if(large {
large=a[i].sal+a[i].allow;
loc=i;
}
}
;
int loc1=0;
int large1 =b[0].hours*b[0].rph ;
for(i=0;i<2;i++)
{
if(large1 {
large1=b[i].hours*b[i].rph ;
loc1=i;
}
}
if(a[loc].sal+a[loc].allow>b[loc1].hours*b[loc1].rph)
{
cout<<"The perment emp is greater sal"< cout< }
else
{
cout<<"The visit emp is greater sal"< cout< }
/*cout<<"the perment emp data"< for(i=0;i<2;i++)
{
cout< }
cout<<"the visiting emp data"< for(i=0;i<2;i++)
{
cout< }
*/
return 0;
}
//contact me by 03226133632



All times are GMT +5. The time now is 06:33 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.