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)
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库C++面向对象程序设计第七章(9)在线全文阅读。
相关推荐: