项目2 - 职员有薪水了
来源:互联网 发布:英语词汇量测试软件 编辑:程序博客网 时间:2024/06/04 18:42
*烟台大学计算机学院学生*All right reserved.*文件名称*烟台大学计算机学院学生*All right reserved.*文件名称:项目2 - 职员有薪水了*作者:杨飞*完成日期:2014年5月5日*版本号:v1.0*对任务及求解方法的描述部分:项目2 - 职员有薪水了*我的程序:#include <iostream>#include <cstring>using namespace std;class CPerson{protected: string m_szName; string m_szId; int m_nSex;//0:women,1:man int m_nAge;public: CPerson(string name,string id,int sex,int age); void Show1(); ~CPerson();};CPerson::CPerson(string name,string id,int sex,int age){ m_szName=name; m_szId=id; m_nSex=sex; m_nAge=age;}CPerson::~CPerson(){}void CPerson::Show1(){ cout<<"名字"<< m_szName<<endl; cout<<"身份证号:"<< m_szId<<endl; cout<<"性别"<<m_nSex<<endl; cout<<"年龄"<<m_nAge<<endl;}class CEmployee:public CPerson{private: string m_szDepartment; double m_Salary;public: CEmployee(string name,string id,int sex,int age,string department,double salary): CPerson(name,id,sex,age),m_szDepartment(department),m_Salary(salary){}; void Show2(); ~CEmployee();};CEmployee::~CEmployee(){}void CEmployee::Show2(){ Show1(); cout<<"部门"<<m_szDepartment<<endl; cout<<"工资"<<m_Salary<<endl;}int main(){ string name,id,department; int sex,age; double salary; cout<<"input employee's name,id,sex(0:women,1:man),age,department,salary:\n"; cin>>name>>id>>sex>>age>>department>>salary; CEmployee employee1(name,id,sex,age,department,salary); employee1.Show2(); return 0;}
运行结果:
心得体会:无!!!
0 0
- 项目2 - 职员有薪水了
- 11【项目2 - 职员有薪水了】
- 项目2—职员有薪水了
- 项目2 - 职员有薪水了
- 第11周 【项目2 - 职员有薪水了】(2)
- 第十一周项目2(2)-职员有薪水了
- 第11周项目2 - 职员有薪水了(2)
- 第十一周 项目2-职员有薪水了(2)
- 第十一周项目2--职员有薪水了(2)
- 第十一周 项目2-职员有薪水了(2)
- 第十一周 项目2 - 职员有薪水了(2)
- 第九周项目 2 职员有薪水了(2)
- 项目2 - 职员有薪水了(扩展)
- 第十一周 项目2--职员有薪水了
- 第十一周项目2-职员有薪水了
- 十一周 项目2 职员有薪水了
- 第十一周项目2-职员有薪水了(扩展)
- 第十一周项目2 职员有薪水了
- OCP-1Z0-051 第67题 ORDER BY子句应用
- Conversion to Dalvik format failed: Unable to execute dex 解决Android打包错误
- 家用小型中央空调发展的现状与趋势
- 动态IP或无公网IP时外网远程桌面访问内网windows
- Java多线程 快速入门(一)
- 项目2 - 职员有薪水了
- tomcat5不支持jstl1.2
- NDK 和 JNI 总结
- Codeforces 276E(Little Girl and Problem on Trees)
- javascript学习参考资料
- 中国科学家发现石头剪刀布制胜策略 想赢有妙招
- SGU 122. The book 哈密尔顿回路 构造
- 项目2 - 职员有薪水了(扩展)
- OCP-1Z0-051 第68题 ORDER BY的默认值