欢迎来到天天文库
浏览记录
ID:16653437
大小:137.00 KB
页数:3页
时间:2018-08-23
《c++程序人事管理的people(人员)类》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、2设计一个用于人事管理的People(人员)类,考虑到通用性,这里只抽象出所有类型人员都具有的属性:number(编号)、sex(性别)、birthday(出生日期)、id(身份证号)等等。其中“出生日期”声明为一个“日期”类内嵌子对象。用成员函数实现对人员信息的录入和显示。要求包括:构造函数和析构函数、拷贝构造函数、内联成员函数、组合。#includeusingnamespacestd;classdate{public:date(intx=0,inty=0,intz=0){year=x;month=y;day=z;}date(date&
2、d);voidsetdate();voidshowdate();private:intyear,month,day;};date::date(date&d){year=d.year;month=d.month;day=d.day;}voiddate::setdate(){inta,b,c;cout<<"输入日期";cin>>a>>b>>c;year=a;month=b;day=c;}voiddate::showdate(){cout<3、le(datebd,longintnb,longintidnb,charsx);people(people&p);voidsetpeople();voidshowpeople();maintenancemeasures,thereisabigsecurityrisk,managementhashadagreatimpacttothecity.3.1-8busterminalstationstatusinYibincitylayouts(4)hoursofoperationmostofYibincitybuslinesin5:30-6:20,andbasica4、llymeettheYibintravelneeds.Busprivate:intnumber,idnumber;charsex;datebirthday;};people::people(datebd,longintnb=0,longintidnb=0,charsx='m'):birthday(bd){birthday=bd;number=nb;idnumber=idnb;sex=sx;}people::people(people&p):birthday(p.birthday){number=p.number;birthday=p.birthday;sex5、=p.sex;idnumber=p.idnumber;}voidpeople::setpeople(){datea;longintb,c;chard;a.setdate();cout<<"号码:";cin>>b;cout<<"id:";cin>>c;cout<<"性别:";cin>>d;Cout<6、<<"sex"<7、eds.Busdateb;b.setdate();peoplep1(b);p1.setpeople();peoplep2(p1);p1.showpeople();return0;}maintenancemeasures,thereisabigsecurityrisk,managementhashadagreatimpacttothecity.3.1-8busterminalstationstatusinYibincitylayouts(4)hoursofoperationmostofYibincitybuslinesin5:30-6:20,andbasica8、llymeettheYibintravelneeds
3、le(datebd,longintnb,longintidnb,charsx);people(people&p);voidsetpeople();voidshowpeople();maintenancemeasures,thereisabigsecurityrisk,managementhashadagreatimpacttothecity.3.1-8busterminalstationstatusinYibincitylayouts(4)hoursofoperationmostofYibincitybuslinesin5:30-6:20,andbasica
4、llymeettheYibintravelneeds.Busprivate:intnumber,idnumber;charsex;datebirthday;};people::people(datebd,longintnb=0,longintidnb=0,charsx='m'):birthday(bd){birthday=bd;number=nb;idnumber=idnb;sex=sx;}people::people(people&p):birthday(p.birthday){number=p.number;birthday=p.birthday;sex
5、=p.sex;idnumber=p.idnumber;}voidpeople::setpeople(){datea;longintb,c;chard;a.setdate();cout<<"号码:";cin>>b;cout<<"id:";cin>>c;cout<<"性别:";cin>>d;Cout<6、<<"sex"<7、eds.Busdateb;b.setdate();peoplep1(b);p1.setpeople();peoplep2(p1);p1.showpeople();return0;}maintenancemeasures,thereisabigsecurityrisk,managementhashadagreatimpacttothecity.3.1-8busterminalstationstatusinYibincitylayouts(4)hoursofoperationmostofYibincitybuslinesin5:30-6:20,andbasica8、llymeettheYibintravelneeds
6、<<"sex"<7、eds.Busdateb;b.setdate();peoplep1(b);p1.setpeople();peoplep2(p1);p1.showpeople();return0;}maintenancemeasures,thereisabigsecurityrisk,managementhashadagreatimpacttothecity.3.1-8busterminalstationstatusinYibincitylayouts(4)hoursofoperationmostofYibincitybuslinesin5:30-6:20,andbasica8、llymeettheYibintravelneeds
7、eds.Busdateb;b.setdate();peoplep1(b);p1.setpeople();peoplep2(p1);p1.showpeople();return0;}maintenancemeasures,thereisabigsecurityrisk,managementhashadagreatimpacttothecity.3.1-8busterminalstationstatusinYibincitylayouts(4)hoursofoperationmostofYibincitybuslinesin5:30-6:20,andbasica
8、llymeettheYibintravelneeds
此文档下载收益归作者所有