文件名称:example
- 所属分类:
- Windows编程
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 255kb
- 下载次数:
- 0次
- 提 供 者:
- 王*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
在程序实例一个小型公司的人员信息管理系统已给的程序代码中存在着两个问题:
(1)基类的成员函数pay( )和displayStatus( )函数体为空,仍然要写出函数体,显得冗余。
(2)在main()函数中,建立了四个不同类的对象,对它们进行了类似的操作,却重复写了四遍类似的语句,程序不够简洁。
运用第六章多态性和虚函数所学的知识对程序进行改进,解决上述两个问题,练习虚函数和纯虚函数的使用及动态多态的实现。
-Instance in a small company' s personnel information management system has given the program code, there are two issues: (1) base class member functions of the pay () and displayStatus () function body is empty, they still have to write a function body, it is redundant. (2) in main () function, the establishment of four different types of objects, they conducted a similar operation, but repeated four times to write a similar statement, the procedure simple enough. Chapter VI the use of virtual function polymorphism and knowledge to improve on the procedures to resolve these two problems, exercises virtual function and pure virtual function of the use and the realization of dynamic polymorphism.
(1)基类的成员函数pay( )和displayStatus( )函数体为空,仍然要写出函数体,显得冗余。
(2)在main()函数中,建立了四个不同类的对象,对它们进行了类似的操作,却重复写了四遍类似的语句,程序不够简洁。
运用第六章多态性和虚函数所学的知识对程序进行改进,解决上述两个问题,练习虚函数和纯虚函数的使用及动态多态的实现。
-Instance in a small company' s personnel information management system has given the program code, there are two issues: (1) base class member functions of the pay () and displayStatus () function body is empty, they still have to write a function body, it is redundant. (2) in main () function, the establishment of four different types of objects, they conducted a similar operation, but repeated four times to write a similar statement, the procedure simple enough. Chapter VI the use of virtual function polymorphism and knowledge to improve on the procedures to resolve these two problems, exercises virtual function and pure virtual function of the use and the realization of dynamic polymorphism.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
example2虚函数
..............\Debug
..............\.....\empfunc.exe
..............\.....\empfunc.ilk
..............\.....\empfunc.obj
..............\.....\empfunc.pch
..............\.....\empfunc.pdb
..............\.....\main.obj
..............\.....\vc60.idb
..............\.....\vc60.pdb
..............\empfunc.cpp
..............\empfunc.dsp
..............\empfunc.dsw
..............\empfunc.ncb
..............\empfunc.opt
..............\empfunc.plg
..............\employee.h
..............\main.cpp
..............\Debug
..............\.....\empfunc.exe
..............\.....\empfunc.ilk
..............\.....\empfunc.obj
..............\.....\empfunc.pch
..............\.....\empfunc.pdb
..............\.....\main.obj
..............\.....\vc60.idb
..............\.....\vc60.pdb
..............\empfunc.cpp
..............\empfunc.dsp
..............\empfunc.dsw
..............\empfunc.ncb
..............\empfunc.opt
..............\empfunc.plg
..............\employee.h
..............\main.cpp