C++面向对象程序设计第七章(9)

2021-02-21 10:47

C++面向对象程序设计

1 2 3 4 5 6 7 8

// Fig. 13.2: CommissionEmployee.cpp member// Class CommissionEmployee member-function definitions. #include <iostream> using std::cout; #include "CommissionEmployee.h" // CommissionEmployee class definition

Outline

// constructor 9 CommissionEmployee::CommissionEmployee( CommissionEmployee::CommissionEmployee( 10 const string &first, const string &last, const string &ssn, 11 double sales, double rate ) 12 : firstName( first ), lastName( last ), socialSecurityNumber( ssn ) 13 { 14 setGrossSales( sales ); // validate and store gross sales 15 setCommissionRate( rate ); // validate and store commission rate 16 } // end CommissionEmployee constructor 17 18 19 20 21 22 23 24 25 26 27 28 // set first name void CommissionEmployee::setFirstName( const string &first ) { firstName = first; // should validate } // end function setFirstName // return first name string CommissionEmployee::getFirstName() const { return firstName; } // end function getFirstName

Commission Employee.cpp

(1 of 4)


C++面向对象程序设计第七章(9).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:医疗废物管理委员会组成、职责及会议制度

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: