#pragma once
#include<iostream>
#include<string>
using namespace std;
class Worker {
public:
//显示个人信息
virtual void showInfo() = 0;
//显示岗位名称
virtual string getDName() = 0;
int m_id;
string m_name;
int m_dId;
};
Boss类(继承自职工抽象类)
#pragma once
#include<iostream>
#include<string>
#include"Worker.h"
using namespace std;
class Boss :public Worker {
public:
Boss(int id, string name, int dId);
void showInfo();
string getDName();
};
经理类(继承自职工抽象类)
#pragma once
#include<iostream>
#include<string>
#include"Worker.h"
using namespace std;
class Manger :public Worker {
public:
Manger(int id, string name, int dId);
void showInfo();
string getDName();
};
普通员工类(继承自职工抽象类)
#pragma once
#include<iostream>
#include<string>
#include"Worker.h"
using namespace std;
class Employee :public Worker {
public:
Employee(int id, string name, int dId);
void showInfo();
string getDName();
};