hourly.h

来自「斯坦福Energy211/CME211课《c++编程——地球科学科学家和工程师》」· C头文件 代码 · 共 50 行

H
50
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?