📄 hourly.h
字号:
// Header file for the Hourly class, derived from the// Employee base class and used to maintain records for// employees paid at an hourly rate#ifndef CLASS_Hourly#define CLASS_Hourly#include "employee.h" // Always include header from // base classclass Hourly : public Employee {public: // Constructor Hourly( const std::string& name, const std::string& ssn, double payrate, int hours ); // Copy constructor Hourly( const Hourly& h ); // Destructor ~Hourly(); // Get/Set pairs for working with member variables inline double GetPayRate() const { return m_PayRate; } inline void SetPayRate( double r ) { m_PayRate = r; } inline int GetHoursPerWeek() const { return m_HoursPerWeek; } inline void SetHoursPerWeek( int h ) { m_HoursPerWeek = h; } // Computes and returns yearly pay, using hourly pay // rate and hours worked per week double GetYearlyPay() const; void SendTo( std::ostream& out ) const; private: double m_PayRate; // hourly pay rate int m_HoursPerWeek; // number of hours worked per week // This is declared private to prevent assignment Hourly& operator=( const Hourly& h ); } ;#endif // CLASS_Hourly
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -