用C++设计一个小型人事信息管理系统

来源:百度知道 编辑:UC知道 时间:2024/05/25 18:48:20
急……星期一就要交了,期末作业……哪位大侠帮帮忙,感激不尽……

问题提出:
有关学校的人事管理情况,作为基类的People(人员)类,具有的属性如下:姓名char name[11],
编号char number[7],性别char sex[3], 生日birthday, 身份证号 char id[16], 其中“出生日期”
定义为一个“日期”类内嵌对象。
People类派生出Student(学生)类,添加属性:班号 char classNo[7]; 从People类派生出teacher(教师)类, 添加属性:职务char Principalship[11],部门char department[21]。
从Student类中派生出graduate(研究生)类,添加属性:专业char subject[21],导师teacher adviser;从graduate类和teacher类派生出TA(助教)类,其中teacher类是从People类派生而来。要求在构造函数中通过键盘实现对各类人员的录入,各类人员都有自己的显示成员函数。按照名字的字母顺序将people类的对象进行排序。注意用虚基类及虚函数。
首先要对类进行分析设计,给出系统的类图。
源程序代码必须要有详细的注释。

请发到我的邮箱 gfchelsea@sina.com
谢谢!!!

#include <iostream>
#include <cstring>
using namespace std;
class People{
char name[11];
char number[7];
char sex[3];
char id[16];
class Date{
public:
int year;
int month;
int day;

Date(){
year=month=day=0;
}
Date(int y,int m,int d){
year=y;
month=m;
day=d;
}
} birthday;
public :
People(){
cout << "请输入名字,学号,性别(man,wom),身份证号:";
cin >> name >> number >> sex >> id;
cout << "请输入出生年,月,日";
cin >> birthday.year >> birthday.month >> birthday.day;
}
People& operator = (People& p){
strcpy(name,p.name);
strcpy(number,p.number);
strcpy(sex,p.sex);
strcpy(id,p.id);
birthday=Date(p.birthday.year,p.birthday.month,p.birthday.day);
return *this;
}//重载赋值操作符
static void