公司员工管理系统(C++继承、多态)

公司员工信息管理系统:(使用C++实现)
1、输入:txt文本,包含员工信息、性别、年龄、工号、部门、职位(职员、部门经理、总经理)等信息。

2、要求功能: 添加、删除、修改员工信息;

    员工显示排序(能够根据任意信息排序)。

    根据某员工查询其上下级员工;
    能够输出所有信息。

3、需要使用知识点:类继承、多态、vector/map容器。

源代码:

1、头文件:

#include <iostream>
#include <cassert>
#include <cstdio>
#include <vector>
#include <string>
using namespace std;
#define EMP "employee"
#define MAG "manage"
#define BOS "boss"
#define Type_Employee 1
#define Type_Manage 2
#define Type_Boss 3
class persion
{
public:
	virtual char GetType() = 0;
};
class employee : public persion				//普通员工
{
public:
	virtual char GetType(){ return Type_Employee; };
	virtual ~employee(){};
	void operator=(employee& b);

public:
	string position;						//职位
	string name;							//姓名         
	int age;								//年龄
	string gender;							//性别
	int number;								//员工编号
	string depart;						    //部门
};
class manage : public employee				//部门经理:手机号、邮箱、负责部门
{
public:
	virtual char GetType(){ return Type_Manage; }
	virtual ~manage(){}
	void operator=(manage& b);

public:
	string tele;
	string mail;
};
class boss : public employee				//总经理:手机号、邮箱、通讯地址
{   
public:
	virtual char GetType(){ return Type_Boss; }
	virtual ~boss(){}
	void operator=(boss& b);
public:
	string tele;
	string mail;
	string addr;
};
class ManageSystem
{
public:
	ManageSystem();	
	~ManageSystem();	
	void Add(employee* pInfo);
	size_t GetSize();
	bool Delete(string& name);
	char GetType(int& num);
	char GetType(string& name);
	bool GetInformation(int& num, employee** ppEmp);
	bool GetInformation(string& name, employee** ppEmp);
	void NumberSort();
	void NameSort();
	void ModifyDepart(string& type,string& depart);
	void ModifyMail(string& type, string& mail);
	void ModifyTele(string& type, string& tele);
	void ModifyAddr(string& type, string& addr);
private:
	size_t FindName(string& name);
	size_t FindNumber(int& num);
private:
	void LoadInformationToSys();							//文件加载员工信息----->系统
	void LoadInformationToFile();							//系统加载员工信息----->文件	
	vector<employee*> _employee;
	FILE* pFile;
};

2、实现文件(.cpp)

#include "Manage_System.h"

void employee::operator=(employee& e)
{
	this->age = e.age;
	this->depart = e.depart;
	this->gender = e.gender;
	this->name = e.name;
	this->number = e.number;
    this->position = e.position;
}
void manage::operator=(manage& m)
{
	this->age = m.age;
	this->depart = m.depart;
	this->gender = m.gender;
	this->mail = m.mail;
	this->name = m.name;
	this->number = m.number;
	this->tele = m.tele;
	this->position = m.position;
}
void boss::operator=(boss& b)
{
	this->addr = b.addr;
	this->age = b.age;
	this->depart = b.depart;
	this->gender = b.gender;
	this->mail = b.mail;
	this->name = b.name;
	this->number = b.number;
	this->tele = b.tele;
	this->position = b.position;
}
ManageSystem::ManageSystem()
{
	LoadInformationToSys();
}
ManageSystem::~ManageSystem()
{
	LoadInformationToFile();									//将信息加载到文件中
	for (size_t i = 0; i < GetSize(); i++)
	{
		switch (_employee[i]->GetType())
		{
		case 1:
			delete _employee[i];
			break;
		case 2:
			delete (manage*)_employee[i];
			break;
		case 3:
			delete (boss*)_employee[i];
			break;
		default:
			break;
		}
		_employee[i] = NULL;
	}
}
bool IsNumberString(string& str)     //判断输入的字符串是否为数字字符串
{
	int sz = str.size();
	for (int i = 0; i < sz; i++)
	{
		if (str[i] < 48 || str[i] > 57)
		{
			return false;
		}
	}
	return true;
}
string i_ReadPart(char* buf, int& index)    //
{
	string strRt = "";
	char szTemp[64] = "";
	int i = 0;
	while (buf[index] != ' ' && buf[index] != '\n' && buf[index] != '\0')	
	{
		szTemp[i++] = buf[index];
		index++;
	}
	if (buf[index] == ' ')
	{
		index++;
	}
	strRt = szTemp;
	return strRt;
}
void i_WritePart(vector<employee*>& em, FILE* fout, int idx)
{
	string sz = "";
	char age[20] = { 0 };
	char number[20] = { 0 };
	itoa(em[idx]->age, age, 10);
	itoa(em[idx]->number, number, 10);
	sz += em[idx]->position;
	sz += " ";
	sz += em[idx]->name;
	sz += " ";
	sz += age;
	sz += " ";
	sz += em[idx]->gender;
	sz += " ";
	sz += number;
	sz += " ";
	sz += em[idx]->depart;
	if (em[idx]->GetType() == Type_Employee)
	{
		sz += "\n";
	}
	if (em[idx]->GetType() == Type_Manage)
	{
		sz += " ";
		sz += ((manage*)em[idx])->tele;
		sz += " ";
		sz += ((manage*)em[idx])->mail;
		sz += "\n";
	}
	if (em[idx]->GetType() == Type_Boss)
	{
		sz += " ";
		sz += ((boss*)em[idx])->tele;
		sz += " ";
		sz += ((boss*)em[idx])->mail;
		sz += " ";
		sz += ((boss*)em[idx])->addr;
		sz += "\n";
	}
	fputs(sz.c_str(), fout);
}
void ReadFile(vector<employee*>& _employee, char* buf, int index)
{
	employee* emply = NULL;
	char chType = 0;
	string strTemp = "";
	strTemp = i_ReadPart(buf, index);
	if (strTemp == EMP)
	{
		emply = new employee();
		chType = Type_Employee;
	}
	else if (strTemp == MAG)
	{
		emply = new manage();
		chType = Type_Manage;
	}
	else if (strTemp == BOS)
	{
		emply = new boss();
		chType = Type_Boss;
	}
	if (!emply) return;    //不空
	emply->position = strTemp;    //职位已经提取出来
	strTemp = i_ReadPart(buf, index);
	if (!strTemp.empty()) emply->name = strTemp;
	strTemp = i_ReadPart(buf, index);
	if (!strTemp.empty()){	int age = atoi(strTemp.c_str()); emply->age = age;  }
	strTemp = i_ReadPart(buf, index);
	if (!strTemp.empty()) emply->gender = strTemp;
	strTemp = i_ReadPart(buf, index);
	if (!strTemp.empty()){  int num = atoi(strTemp.c_str()); emply->number = num; }
	strTemp = i_ReadPart(buf, index);
	if (!strTemp.empty()) emply->depart = strTemp;
	if (chType == Type_Manage)
	{
		strTemp = i_ReadPart(buf, index);
		if (!strTemp.empty()) ((manage*)emply)->tele = strTemp;
		strTemp = i_ReadPart(buf, index);
		if (!strTemp.empty()) ((manage*)emply)->mail = strTemp;
	}
	if (chType == Type_Boss)
	{
		strTemp = i_ReadPart(buf, index);
		if (!strTemp.empty()) ((boss*)emply)->tele = strTemp;
		strTemp = i_ReadPart(buf, index);
		if (!strTemp.empty()) ((boss*)emply)->mail = strTemp;
		strTemp = i_ReadPart(buf, index);
		if (!strTemp.empty()) ((boss*)emply)->addr = strTemp;
	}
	_employee.push_back(emply);
}
void ManageSystem::LoadInformationToSys()							//加载员工信息到系统
{
	pFile = fopen("EmployeeInformation.txt", "r");
	assert(pFile);
	char buf[128];
	int index = 0;
	while (!feof(pFile))
	{
		index = 0;
		memset(buf, 0, sizeof(buf));
		fgets(buf, sizeof(buf), pFile);							//fgets会读取一行,并在最后加上'\0';
		ReadFile(_employee, buf,index);
	}
	if (fclose(pFile) != 0)	//关闭文件
	{
		cout << "关闭失败" << endl;
		return;
	}
}
void ManageSystem::LoadInformationToFile()								//将信息加载到文件中
{
	FILE* fout = fopen("EmployeeInformation.txt","w");
	size_t i = 0;
	while (i < GetSize())
	{
		i_WritePart(_employee,fout, i);
		i++;
	}
	fclose(fout);
}
void ManageSystem::Add(employee* pInfo)							//添加新员工
{
	if (pInfo == NULL) 
		return;
	char type = pInfo->GetType();
	if (1 == type)
	{
		employee* pEm = new employee();
		*pEm = *pInfo;
		_employee.push_back(pEm);
	}
	if (2 == type)
	{
		employee* pManage = new manage();
		*((manage*)pManage) = *((manage*)pInfo);
		_employee.push_back(pManage);
	}
	if (3 == type)
	{
		employee* pBoss = new boss();
		*((boss*)pBoss) = *((boss*)pInfo);
		_employee.push_back(pBoss);
	}
}
size_t ManageSystem::GetSize()
{
	return _employee.size();
}
bool ManageSystem::Delete(string& name)			//姓名或员工编号均可删除
{
	int ret = -1;
	int num = -1;
	if (IsNumberString(name))					//输入是员工编号,,找下标
	{
		num = atoi(name.c_str());
	    ret = FindNumber(num);
	}
	else										//输入是员工姓名,,找下标
	{
		ret = FindName(name);
	}
	if (ret == -1 )
		return false;
	delete _employee[ret];
	_employee[ret] = NULL;
	for (size_t i = ret; i < _employee.size() - 1; i++)
	{
		_employee[i] = _employee[i + 1];
	}
	_employee.pop_back();
	return true;
}
size_t ManageSystem::FindName(string& name)
{
	for (size_t i = 0; i < _employee.size(); i++)
	{
		if (name == _employee[i]->name)
		{
			return i;
		}
	}
	return -1;
}
size_t ManageSystem::FindNumber(int& num)
{
	for (size_t i = 0; i < _employee.size(); i++)
	{
		if (num == _employee[i]->number)
		{
			return i;
		}
	}
	return -1;
}     
char ManageSystem::GetType(int& num)
{
	int nIndex = FindNumber(num);
	if (nIndex != -1)
	{
		return _employee[nIndex]->GetType();
	}
	return 0;
}
char ManageSystem::GetType(string& name)
{
	int nIndex = FindName(name);
	if (nIndex != -1)
	{
		return _employee[nIndex]->GetType();
	}
	return 0;
}
bool ManageSystem::GetInformation(int& num, employee** ppEmp)    //传编号
{
	if (!ppEmp) return false;
	int nIndex = FindNumber(num);
	if (nIndex != -1)
	{
		if (GetType(num) == Type_Employee)  **ppEmp = *(_employee[nIndex]);
		if (GetType(num) == Type_Manage)	*((manage*)(*ppEmp)) = *((manage*)_employee[nIndex]);
		if (GetType(num) == Type_Boss)	*((boss*)(*ppEmp)) = *((boss*)_employee[nIndex]);
		return true;
	}
	return false;
}
bool ManageSystem::GetInformation(string& name, employee** ppEmp)    //传编号
{
	if (!ppEmp) return false;
	int nIndex = FindName(name);
	if (nIndex != -1)
	{
		if (GetType(name) == Type_Employee)  **ppEmp = *(_employee[nIndex]);
		if (GetType(name) == Type_Manage)	*((manage*)(*ppEmp)) = *((manage*)_employee[nIndex]);
		if (GetType(name) == Type_Boss)	*((boss*)(*ppEmp)) = *((boss*)_employee[nIndex]);
		return true;
	}
	return false;
}
void ManageSystem::NumberSort()              //按员工编号排序
{
	for (size_t i = 0; i < GetSize(); i++)
	{
		for (size_t j = 0; j < GetSize() - 1 - i; j++)
		{
			if (_employee[j]->number > _employee[j + 1]->number)
			{
				swap(_employee[j], _employee[j + 1]);
			}
		}
	}
}
void ManageSystem::NameSort()			//按姓名编号排序
{
	for (size_t i = 0; i < GetSize(); i++)
	{
		for (size_t j = 0; j < GetSize() - 1 - i; j++)
		{
			if (strcmp(_employee[j]->name.c_str(), _employee[j + 1]->name.c_str()) > 0)
			{
				swap(_employee[j], _employee[j + 1]);
			}
		}
	}
}
void ManageSystem::ModifyDepart(string& type,string& depart)    //type为姓名或员工编号
{
	if (IsNumberString(type))
	{
		int number = atoi(type.c_str());
		_employee[FindNumber(number)]->depart = depart;
		return;
	}
	_employee[FindName(type)]->depart = depart;
}
void ManageSystem::ModifyAddr(string& type,string& addr)
{
	if (IsNumberString(type))
	{
		int number = atoi(type.c_str());
		((boss*)_employee[FindNumber(number)])->addr = addr;
		return;
	}
	((boss*)(_employee[FindName(type)]))->addr = addr;
}
void ManageSystem::ModifyMail(string& type,string& mail)
{
	if (IsNumberString(type))
	{
		int number = atoi(type.c_str());
		((manage*)_employee[FindNumber(number)])->mail = mail;
		return;
	}
	((manage*)(_employee[FindName(type)]))->mail = mail;
}
void ManageSystem::ModifyTele(string& type, string& tele)
{
	if (IsNumberString(type))
	{
		int number = atoi(type.c_str());
		((manage*)_employee[FindNumber(number)])->tele = tele;
		return;
	}
	((manage*)(_employee[FindName(type)]))->tele = tele;
}

3、测试文件(test.cpp)

#include "Manage_System.h"
struct Base
{
	int in;
	int mode = 0;
	int number = -1;
	int age = -1;
	int newNumber;
	int newAge;
	char gender[10];
	char name[20];
	char position[20];
	char depart[15];
	char tele[15];
	char mail[20];
	char addr[25];
	char type[20];
	string _name; 
	string newTele; 
	string newMail;
	string newAddr; 
	string newPosition; 
	string newDepart;
	string newGender;
	string _type;
};
Base Temp;
bool IsNumberString(string& str);     //判断输入的字符串是否为数字字符串
enum 
{
	QUIT,
	ADD,
	DELETE,
	MODFIY,
	SORT,
	FIND
};
void Menu()
{
	cout << endl;
	cout << " ==========菜单==========" << endl;
	cout << "|" << "   ";
	cout << "1 add      2 delete  " << "|" << endl;
	cout << "|" << "   ";
	cout << "3 modfiy   4 sort    " << "|" << endl;
	cout << "|" << "   ";
	cout << "5 find     0 quit    " << "|" << endl;
	cout << " =========================" << endl;
} 
void BaseInformation()
{
	cout << "请输入姓名: ";
	gets(Temp.name);
	cout << "请输入年龄: ";
	scanf("%d", &Temp.age);
	cout << "请输入性别: ";
	getchar();
	gets(Temp.gender);
	cout << "请输入员工编号: ";
	scanf("%d", &Temp.number);
	cout << "请输入部门: ";
	getchar();
	gets(Temp.depart);
}
void AddEmployee(ManageSystem& s)
{
	employee* pEm = new employee;
	BaseInformation();
	pEm->name = Temp.name;
	pEm->number = Temp.number;
	pEm->gender = Temp.gender;
	pEm->age = Temp.age;
	pEm->position = Temp.position;
	pEm->depart = Temp.depart;
	s.Add(pEm);
	delete pEm;
	pEm = NULL;
}
void AddManage(ManageSystem& s)
{
	BaseInformation();
	cout << "请输入电话: ";
	getchar();
	gets(Temp.tele);
	cout << "请输入邮箱: ";
	gets(Temp.mail);
	manage* pMa = new manage;
	pMa->depart = Temp.depart;
	pMa->name = Temp.name;
	pMa->age = Temp.age;
	pMa->tele = Temp.tele;
	pMa->position = Temp.position;
	pMa->number = Temp.number;
	pMa->gender = Temp.gender;
	pMa->mail = Temp.mail;
	s.Add(pMa);
	delete pMa;
}
void AddBoss(ManageSystem& s)
{
	boss* pBo = new boss;
	BaseInformation();
	cout << "请输入电话: ";
	gets(Temp.tele);
	cout << "请输入邮箱: ";
	gets(Temp.mail);
	cout << "请输入地址: ";
	gets(Temp.addr);
	pBo->addr = Temp.addr;
	pBo->age = Temp.age;
	pBo->mail = Temp.mail;
	pBo->tele = Temp.tele;
	pBo->depart = Temp.depart;
	pBo->position = Temp.position;
	pBo->number = Temp.number;
	pBo->gender = Temp.gender;
	pBo->name = Temp.name;
	s.Add(pBo);
	delete pBo;
}
void Delete(ManageSystem& s)                    //删除
{
	getchar();
	cout << "请输入要删除的姓名或员工编号:" << endl;
	gets(Temp.name);
	Temp._name = Temp.name;
	if (s.Delete(Temp._name) == true)
		cout << "删除成功!!!" << endl;
	else
		cout << "你要删除的名字不存在!!!" << endl;
}
void Print(employee* pEm)
{
	if (pEm == NULL)
	{
		cout << "你要查找的员工不存在!!!" << endl;
		return;
	}
	cout << pEm->position << " " << pEm->name << " " << pEm->gender << " " << pEm->depart 
		<< " " << pEm->number << " " << pEm->age ;
	if (pEm->GetType() == Type_Employee)  { cout << endl;  return; }
	if (pEm->GetType() == Type_Manage)
	{
		cout << " " << ((manage*)pEm)->tele << " " << ((manage*)pEm)->mail << endl;;
		return;
	}
	if (pEm->GetType() == Type_Boss)
	{
		cout <<  " " << ((boss*)pEm)->tele << " " << ((boss*)pEm)->mail << " " << ((boss*)pEm)->addr << endl;
		return;
	}
}
void ShowInfo(ManageSystem& s, string& str)
{
	if (IsNumberString(str))             //是数字字符串的话,转成数字
	{
		int num = atoi(str.c_str());
		if (s.GetType(num) == Type_Employee)
		{
			employee* pEm = new employee();
			bool ret = s.GetInformation(num, &pEm);
			if (ret == false)
			{
				cout << "输入错误!!!" << endl;
				return;
			}
			Print(pEm);
			delete pEm;
			return;
		}
		if (s.GetType(num) == Type_Manage)
		{
			manage* pMa = new manage();
			bool ret = s.GetInformation(num, (employee**)&pMa);
			if (ret == false)
			{
				cout << "输入错误!!!" << endl;
				return;
			}
			Print(pMa);
			delete pMa;
			return;
		}
		if (s.GetType(num) == Type_Boss)
		{
			boss* pBo = new boss();
			bool ret = s.GetInformation(num, (employee**)&pBo);
			if (ret == false)
			{
				cout << "输入错误!!!" << endl;
				return;
			}
			Print(pBo);
			delete pBo;
			return;
		}
	}
	if (s.GetType(str) == Type_Employee)
	{
		employee* pEm = new employee();
		bool ret = s.GetInformation(str, &pEm);
		if (ret == false)
		{
			cout << "输入错误!!!" << endl;
			return;
		}
		Print(pEm);
		delete pEm;
		return;
	}
	if (s.GetType(str) == Type_Manage)
	{
		manage* pMa = new manage();
		bool ret = s.GetInformation(str, (employee**)&pMa);
		if (ret == false)
		{
			cout << "输入错误!!!" << endl;
			return;
		}
		Print(pMa);
		delete pMa;
		return;
	}
	if (s.GetType(str) == Type_Boss)
	{
		boss* pBo = new boss();
		bool ret = s.GetInformation(str, (employee**)&pBo);
		if (ret == false)
		{
			cout << "输入错误!!!" << endl;
			return;
		}
		Print(pBo);
		delete pBo;
		return;
	}
	cout << "输入错误!!!" << endl;
}
void Show(ManageSystem& s)
{
	cout << "请输入要查看的员工姓名或编号:" << endl;
	char ch[20] = { 0 };
	getchar();
	gets(ch);
	string str = ch;							//str为员工姓名或员工编号
	ShowInfo(s, str);
}
void ModflyInformation(ManageSystem& s, int num, string& input)  //num为修改的内容,input为姓名或编号
{
	if (num == 1)
	{
		cout << "请输入修改后的部门->:" << endl;
		getchar();
		gets(Temp.depart);
		Temp.newDepart = Temp.depart;
		s.ModifyDepart(input, Temp.newDepart);
	}
	if (num == 2)
	{
		cout << "请输入修改后邮箱->:" << endl;
		getchar();
		gets(Temp.mail);
		Temp.newDepart = Temp.mail;
		s.ModifyMail(input, Temp.newDepart);
	}
	if (num == 3)
	{
		cout << "请输入修改后电话->:" << endl;
		getchar();
		gets(Temp.tele);
		Temp.newTele = Temp.tele;
		s.ModifyMail(input, Temp.newTele);
	}
	if (num == 4)
	{
		cout << "请输入修改后地址->:" << endl;
		getchar();
		gets(Temp.addr);
		Temp.newAddr = Temp.addr;
		s.ModifyMail(input, Temp.newAddr);
	}
}
void Modfly(ManageSystem& s)
{
	cout << "请输入要修改的员工姓名或员工编号->:" << endl;
	getchar();
	gets(Temp.type);
	Temp._type = Temp.type;
	cout << "基本信息: " << endl;
	ShowInfo(s, Temp._type);
	cout << "请选择修改内容: " << endl;
	cout << "1、修改部门 2、修改邮箱 3、修改电话 4、修改地址 " << endl;
	scanf("%d", &Temp.mode);
	ModflyInformation(s, Temp.mode, Temp._type);
}
void Sort(ManageSystem& s)
{
	int ret = -1;
	cout << "请选择排序类型: 1、按员工姓名排序  2、按员工编号排序" << endl;
	scanf("%d", &ret);
	switch (ret)
	{
	case 1:	s.NameSort();	break;
	case 2:	s.NumberSort();	break;
	default:
		break;
	}
}
void Add(ManageSystem& s)
{
	cout << "请输入员工职位->: ";
	getchar();
	gets(Temp.position);
	if (strcmp(Temp.position, EMP) == 0) AddEmployee(s);					//添加员工
	if (strcmp(Temp.position, MAG) == 0) AddManage(s);					//添加经理
	if (strcmp(Temp.position, BOS) == 0) AddBoss(s);						//添加老板
}
int main()
{
	ManageSystem s;
	while (1)
	{
		Menu();
		int input = 0;
		cout << "请输入操作: "<<endl;
		scanf("%d", &input);
		if (input == 0)
			break;
		switch (input)
		{
		case ADD:	    Add(s);		break;			//添加       
		case DELETE:	Delete(s);	break;			//删除
		case FIND:	    Show(s);	break;			//查找
		case SORT:	    Sort(s);	break;			//排序
		case MODFIY:	Modfly(s);	break;			//修改
		default:
			break;
		}
	}
	system("pause");
	return 0;
}

 

【员工管理系统】 问题描述:每个员工的信息包括:编号、姓名、性别、出生年月、学历、职务、电话、住址等。系统能够完成员工信息的查询、更新、插入、删除、排序等功能。 基本要求:排序:按不同关键字,对所有员工的信息进行排序;查询:按特定条件查找员工;更新,按编号对某个员工的某项信息进行修改;插入,加入新员工的信息;删除,按编号删除已离职的员工的信息。 选作内容:实现图形用户界面。 通过链表实现 数据结构: #include #include #include #include #include using namespace std; typedef struct workers{ char name[15];//姓名 char department[18];//单位 char gender;//性别 unsigned int age;//年龄 unsigned long long telephone;//电话 unsigned long wage;//工资 unsigned long num;//职工号 struct workers *next; }*Linklist,Lnode; void frist_print() { printf("\t\t⊙▽⊙ ⊙▽⊙ ⊙▽⊙ ⊙▽⊙ ⊙▽⊙ ⊙▽⊙ \n\n"); printf("\t\t\t欢迎进入员工管理系统\n"); } void menu() { printf("\n\t\t^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"); printf("\t\t \t ◎1.创建员工信息\t \n"); printf("\t\t \t ◎2.插入员工信息\t \n"); printf("\t\t \t ◎3.修改员工信息\t \n"); printf("\t\t \t ◎4.删除员工信息\t \n"); printf("\t\t \t ◎5.查询员工信息\t \n"); printf("\t\t \t ◎6.员工信息排序\t \n"); printf("\t\t \t ◎7.显示员工信息\t \n"); printf("\t\t \t ◎8.员工工资情况\t \n"); printf("\n\t\t^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"); printf("注意:输入均以回车作为结束\n"); printf("please choise 1--8:\t "); //putchar(12); } void Inset(Linklist Head){ Linklist s,L; unsigned int agee; unsigned long wagee,numm;
公司员工信息管理系统C++是一套用于管理和维护企业员工数据的软件系统。这系统通常包括员工的基本信息录入、修改、查询、删除等功能,以及可能的考勤管理、工资计算等模块。使用C++语言开发这样的系统可以充分利用其面向对象的特性,比如封装、继承多态,以设计出结构清晰、易于扩展和维护的程序。 一般来说,一个员工信息管理系统可能包含以下几个主要部分: 1. 数据结构设计:定义员工(Employee),包含属性如员工ID、姓名、性别、部门、职位、入职日期、联系方式等。同时可能包含管理员(Administrator)以及系统中其他相关。 2. 数据持久化:通常使用文件系统或数据库来存储员工信息。使用数据库管理系统(如SQLite、MySQL等)可以更方便地处理大量数据和复杂查询。 3. 功能实现:包括员工信息的添加、修改、查询和删除等操作。这些操作可以通过命令行界面(CLI)或图形用户界面(GUI)来进行交互。 4. 权限控制:管理系统可能包含不同级别的用户权限,如普通员工、部门经理和系统管理员,以确保数据的安全性和隐私性。 在C++中实现这样的系统可能需要使用到如下技术或知识点: - 对象的创建和使用 - 文件操作,如读写文件 - 数据库连接和操作(如果使用数据库) - 指针和动态内存管理 - 程序流程控制,如循环和条件判断 - 标准库的使用,如string、vector等
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值