再读C++ Primer 写了个小例子(08-01-16)
2008-03-19 21:35
513 查看
实现了几个类的继承操作 ,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma once
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "employee.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class Developer :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
public Employee
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~Developer(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer(int iTimeInJob);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer(Developer& dev);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Developer(char* plname,char* plid,char* pljt,int iTimeInJob);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer::Developer(char* plname,char* plid,char* pljt,int iTimeInJob) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(plname,plid,pljt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TimeInJob = iTimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int GetTimeInJob();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int TimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma once
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using namespace std;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class Employee
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~Employee(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(char* plname,char* plid,char* pljt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
virtual void Job()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Employee::show()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"I'm Employee"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* GetName();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* GetId();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* GetJoinTime();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char Name[20];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char ID[8];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char JoinTime[16];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma once
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "employee.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Developer.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class Leader :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
public Employee
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader(char* plname,char* plid,char* pljt,Developer* dev1,Developer* dev2) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(plname,plid,pljt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[0]=dev1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[1]=dev2;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TotalTime=dev1->GetTimeInJob() +dev2->GetTimeInJob();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int GetTotaltime()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return TotalTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~Leader(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer* devList[2];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int TotalTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma once
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "employee.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Leader.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class Manager :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
public Employee
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~Manager(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager(char* plname,char* plid,char* pljt,Leader* leader1,Leader* leader2) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(plname,plid,pljt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[0]=leader1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[1]=leader2;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
iTotalTime=leader1->GetTotaltime() +leader2->GetTotaltime();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int GetTotalTime()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return iTotalTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader* LeaderList[2];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int iTotalTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
// class08011601.cpp : Defines the entry point for the console application.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "stdafx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Employee.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Developer.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Manager.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Leader.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using namespace std;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
int _tmain(int argc, _TCHAR* argv[])
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* Ename=new char[20];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* Eid=new char[20];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* Etime=new char[20];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int time;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cin>>Ename>>Eid>>Etime>>time;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee emp(Ename,Eid,Etime);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer dev(Ename,Eid,Etime,time);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer dev1(dev);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader leader1(Ename,Eid,Etime,&dev1,&dev1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader leader2(Ename,Eid,Etime,&dev1,&dev1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager manager(Ename,Eid,Etime,&leader1,&leader2);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager manager1(Ename,Eid,Etime,&leader1,&leader2);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager manager2(Ename,Eid,Etime,&leader1,&leader2);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager manager3(Ename,Eid,Etime,&leader1,&leader2);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Manager manager((Ename,Eid,Etime,&leader1,&leader2);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// cout<<emp.GetId()<<emp.GetJoinTime()<<emp.GetName()<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
emp.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// emp.Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// dev.Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dev.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dev1.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
leader1.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
leader2.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
manager.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
manager1.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
manager2.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
manager3.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char a;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cin>>a;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete Ename;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Ename=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete Eid;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Eid=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete Etime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Etime=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "StdAfx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include ".developer.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using namespace std;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Developer::Developer(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TimeInJob = 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Developer::~Developer(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Developer::Developer(Developer& dev)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(Developer::GetId(),dev.GetId());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(Developer::GetJoinTime(),dev.GetJoinTime());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(Developer::GetName(),dev.GetName());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer::TimeInJob=dev.TimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void Developer::Job()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee::Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Done a job"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Developer::Developer(int iTimeInJob)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TimeInJob = iTimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**//*Developer::Developer(char* plname,char* plid,char* pljt,int iTimeInJob) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(char* plname,char* plid,char* pljt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TimeInJob = iTimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void Developer::Show()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee::Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<Developer::GetTimeInJob()<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
int Developer::GetTimeInJob()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return TimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "StdAfx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include ".employee.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using namespace std;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Employee::Employee(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
memset(Name,0,sizeof(Name));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
memset(ID,0,sizeof(ID));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
memset(JoinTime,0,sizeof(JoinTime));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Employee::~Employee(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Employee::Employee(char* plname,char* plid,char* pljt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(Name,plname);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(ID,plid);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(JoinTime,pljt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**//*virtual void Employee::Job()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"I'm Employee"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
char* Employee::GetName()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return Name;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
char* Employee::GetId()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return ID;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
char* Employee::GetJoinTime()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return JoinTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void Employee::Show()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<GetId()<<" ";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<GetName()<<" ";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<GetJoinTime()<<" ";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "StdAfx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include ".leader.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using namespace std;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Leader::Leader(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[0]=new Developer();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[1]=new Developer();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Leader::~Leader(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete devList[0];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete devList[1];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[0] = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[1]=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void Leader::Job()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"---------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Leader Information"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader::Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"---------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Leader Job"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[0]->Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[1]->Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Leader Total Time: "<<Leader::GetTotaltime()<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"---------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "StdAfx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include ".manager.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Manager::Manager(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[0]=new Leader();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[1]=new Leader();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Manager::~Manager(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete LeaderList[0];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete LeaderList[1];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[0] = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[1]=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void Manager::Job()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"--------------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Manager information"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager::Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"--------------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Manager Job"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[0]->Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[1]->Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Manager Total Time: "<<Manager::GetTotalTime()<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"-------------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma once
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "employee.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class Developer :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
public Employee
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~Developer(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer(int iTimeInJob);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer(Developer& dev);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Developer(char* plname,char* plid,char* pljt,int iTimeInJob);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer::Developer(char* plname,char* plid,char* pljt,int iTimeInJob) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(plname,plid,pljt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TimeInJob = iTimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int GetTimeInJob();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int TimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma once
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using namespace std;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class Employee
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~Employee(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(char* plname,char* plid,char* pljt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
virtual void Job()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Employee::show()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"I'm Employee"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* GetName();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* GetId();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* GetJoinTime();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char Name[20];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char ID[8];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char JoinTime[16];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma once
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "employee.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Developer.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class Leader :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
public Employee
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader(char* plname,char* plid,char* pljt,Developer* dev1,Developer* dev2) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(plname,plid,pljt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[0]=dev1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[1]=dev2;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TotalTime=dev1->GetTimeInJob() +dev2->GetTimeInJob();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int GetTotaltime()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return TotalTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~Leader(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer* devList[2];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int TotalTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma once
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "employee.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Leader.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class Manager :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
public Employee
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~Manager(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager(char* plname,char* plid,char* pljt,Leader* leader1,Leader* leader2) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(plname,plid,pljt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[0]=leader1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[1]=leader2;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
iTotalTime=leader1->GetTotaltime() +leader2->GetTotaltime();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int GetTotalTime()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return iTotalTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader* LeaderList[2];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int iTotalTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
// class08011601.cpp : Defines the entry point for the console application.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "stdafx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Employee.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Developer.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Manager.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Leader.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using namespace std;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
int _tmain(int argc, _TCHAR* argv[])
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* Ename=new char[20];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* Eid=new char[20];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char* Etime=new char[20];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int time;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cin>>Ename>>Eid>>Etime>>time;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee emp(Ename,Eid,Etime);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer dev(Ename,Eid,Etime,time);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer dev1(dev);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader leader1(Ename,Eid,Etime,&dev1,&dev1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader leader2(Ename,Eid,Etime,&dev1,&dev1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager manager(Ename,Eid,Etime,&leader1,&leader2);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager manager1(Ename,Eid,Etime,&leader1,&leader2);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager manager2(Ename,Eid,Etime,&leader1,&leader2);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager manager3(Ename,Eid,Etime,&leader1,&leader2);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Manager manager((Ename,Eid,Etime,&leader1,&leader2);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// cout<<emp.GetId()<<emp.GetJoinTime()<<emp.GetName()<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
emp.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// emp.Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// dev.Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dev.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dev1.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
leader1.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
leader2.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
manager.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
manager1.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
manager2.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
manager3.Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
char a;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cin>>a;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete Ename;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Ename=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete Eid;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Eid=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete Etime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Etime=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "StdAfx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include ".developer.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using namespace std;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Developer::Developer(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TimeInJob = 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Developer::~Developer(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Developer::Developer(Developer& dev)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(Developer::GetId(),dev.GetId());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(Developer::GetJoinTime(),dev.GetJoinTime());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(Developer::GetName(),dev.GetName());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Developer::TimeInJob=dev.TimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void Developer::Job()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee::Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Done a job"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Developer::Developer(int iTimeInJob)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TimeInJob = iTimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**//*Developer::Developer(char* plname,char* plid,char* pljt,int iTimeInJob) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee(char* plname,char* plid,char* pljt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TimeInJob = iTimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void Developer::Show()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Employee::Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<Developer::GetTimeInJob()<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
int Developer::GetTimeInJob()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return TimeInJob;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "StdAfx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include ".employee.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using namespace std;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Employee::Employee(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
memset(Name,0,sizeof(Name));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
memset(ID,0,sizeof(ID));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
memset(JoinTime,0,sizeof(JoinTime));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Employee::~Employee(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Employee::Employee(char* plname,char* plid,char* pljt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(Name,plname);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(ID,plid);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strcpy(JoinTime,pljt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**//*virtual void Employee::Job()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"I'm Employee"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
char* Employee::GetName()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return Name;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
char* Employee::GetId()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return ID;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
char* Employee::GetJoinTime()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return JoinTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void Employee::Show()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<GetId()<<" ";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<GetName()<<" ";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<GetJoinTime()<<" ";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "StdAfx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include ".leader.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using namespace std;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Leader::Leader(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[0]=new Developer();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[1]=new Developer();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Leader::~Leader(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete devList[0];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete devList[1];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[0] = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[1]=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void Leader::Job()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"---------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Leader Information"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Leader::Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"---------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Leader Job"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[0]->Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
devList[1]->Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Leader Total Time: "<<Leader::GetTotaltime()<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"---------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "StdAfx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include ".manager.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Manager::Manager(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[0]=new Leader();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[1]=new Leader();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Manager::~Manager(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete LeaderList[0];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
delete LeaderList[1];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[0] = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[1]=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void Manager::Job()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"--------------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Manager information"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Manager::Show();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"--------------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Manager Job"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[0]->Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
LeaderList[1]->Job();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"Manager Total Time: "<<Manager::GetTotalTime()<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cout<<"-------------------------------"<<endl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
相关文章推荐
- 再读C++ Primer 写了个小例子——练习多态虚函数的特性(08-01-25)
- 再读C++ Primer 写了个小例子——运算符重载(08-01-17)
- 再读C++ Primer 写了个小例子——模板的操作(08-01-18)
- 再读C++ Primer 写了个小例子——实现Vector类的自动添加元素功能(08-12-10)
- 再读C++ Primer 写了个小例子——实现stack类的压栈弹栈功能(08-12-10)
- 《C++ Primer》第五版课后习题解答_第二章(1)(01-08)
- C++ Primer, Exercise 08-03,08_14,08_15,08_16
- 再读C++ Primer 写了些小例子来熟悉C++基本语法
- 再读C++ Primer 写了个小例子——友员类的操作
- ARM的异常处理方式简单介绍(16_08_26_01)
- 《C++ Primer》第五版课后习题解答_第五章(1)(01-08)
- 08-01-16
- 再读C++ Primer 写了个小例子——网络编程
- 08-01 java 帮助文档的制作和使用,使用jdk提供的帮助文档
- 07-08-01学习日记(2)
- C++ Primer 学习笔记16 string字符串
- OC_08_01 KVC
- 01-16:SQLite使用方法
- 一个简单的Cairngorm框架例子_01
- [16-1-01]大型网站架构演化