全文预览

语言程序设计实验答案继承与派生

上传者:叶子黄了 |  格式:doc  |  页数:15 |  大小:246KB

文档介绍
urndd;}?voidSetyy(inty){yy=y;}?voidSetmm(intm){mm=m;}?voidSetdd(intd){dd=d;}};classPeople{private:?charname[11]; //姓名,增添?charnumber[7];?//编号,改为数组?charsex[3]; //男或女,改为数组?Datebirthday; //出生日期?charid[16]; //身份证号,改为数组public:?People(){}?People(People&p);?~People(){}?voidGetname(charna[]){strcpy(na,name);}?voidGetnumber(charnu[]){strcpy(nu,number);}?voidGetsex(charse[]){strcpy(se,sex);}?intGetbirthyy()const{returnbirthday.Getyy();}?intGetbirthmm()const{returnbirthday.Getmm();}?intGetbirthdd()const{returnbirthday.Getdd();}?voidGetid(chard[]){strcpy(d,id);}?voidSetname(charna[]){strcpy(name,na);}?voidSetnumber(charnu[]){strcpy(number,nu);}?voidSetsex(charse[]){strcpy(sex,se);}?voidSetbirthyy(inty){birthday.Setyy(y);}?voidSetbirthmm(intm){birthday.Setmm(m);}?voidSetbirthdd(intd){birthday.Setdd(d);}

收藏

分享

举报
下载此文档