文件名称:运算符重载
介绍说明--下载内容来自于网络,使用问题请自行百度
1、设计一个用于人事管理的People(人员)类。考虑到通用性,这里只抽象出所有类型人员都具有的属性:number(编号)、sex(性别)、birthday(出生日期)、id(身份证号)等等。其中“出生日期”定义为一个“日期”类内嵌子对象。用成员函数实现对人员信息的录入和显示。要求包括:构造函数和析构函数、拷贝构造函数、内联成员函数、聚集。
2、对people类重载“==”运算符和“=”运算符,“==”运算符判断两个people类对象的id属性是否相等;“=”运算符实现people类对象的赋值操作。(Design a People (personnel) class for personnel management. In view of generality, only the properties of all types of people are abstracted: number (numbering), sex (sex), birthday (date of birth), ID (ID number) and so on. The "birth date" is defined as a "date" class embedded child object. Member function is used to input and display personnel information. The requirements include: constructor and destructor, copy constructor, inline member function, and aggregate)
2、对people类重载“==”运算符和“=”运算符,“==”运算符判断两个people类对象的id属性是否相等;“=”运算符实现people类对象的赋值操作。(Design a People (personnel) class for personnel management. In view of generality, only the properties of all types of people are abstracted: number (numbering), sex (sex), birthday (date of birth), ID (ID number) and so on. The "birth date" is defined as a "date" class embedded child object. Member function is used to input and display personnel information. The requirements include: constructor and destructor, copy constructor, inline member function, and aggregate)
相关搜索: 运算符重载
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
yunsuanfa.cpp | 1242 | 2018-04-06 |
yunsuanfb.cpp | 1916 | 2018-04-06 |
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.