题目内容
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。
[说明]
本程序使用类来管理员工的通讯地址信息。已知程序的输出为:
输出记录:5
姓名:王丽华
街道地址:中华路15号
市:襄樊市
省;湖北省
邮政编码:430070
[C++程序]
include < iostream, h >
include < string, h >
class employee.
{ protected:
char name[10];
char street[ 20 ];
char city[10];
char (1) [10];
char post[7];
int no;
(2):
(3) (char [] ,char [] ,char [] ,char [] ,char [] ,int);
void changename (char n [] ) { strcpy (name, n); }
void changestreet(char s[] ) { strcpy(street,s) ;}
void changecity (char c [] ) { strcpy (city, c ); }
void changeprov(char p [] ) { strcpy(prov,p); }
void changeno(int nnm) { (4);}
void display();
};
employee:: (3) (char n[] ,char s[] ,char c[] ,char p1[] ,char p2[] ,int nam)
{ strcpy(name,n);
strcpy (street, s);
strcpy (city, c);
strcpy (prov, p1 );
strcpy (post, p2 );
no = nam; }
void employee:: display() { cont< <"输出记录: "< <no< <endl;
cout< < "姓名: "< < name < < endl;
coot < < "街道地址: "< < street < < endl;
cout < < "市: "< < city < < endl;
cout< <"省: "< <prov < <endl;
cout < <"邮政编码: "< < post < < endl;
}
void main() { employee cmp("王华" ,"中华路15号" ,"武汉市","湖北省","430070", 1 );
emp. changename("五丽华" );
emp. changecity ("襄樊市" );
emp. changeno(5);
(5);
查看答案
搜索结果不匹配?点我反馈