?? emp_exceptions.h
字號(hào):
// Header file for employee-related exception classes#ifndef EMP_EXCEPTIONS#define EMP_EXCEPTIONS#include <string>// Base class for any employee-related error conditionclass EmpException {public: EmpException( std::string name ) { m_Name = name; } EmpException( const EmpException& e ) { m_Name = e.m_Name; } virtual ~EmpException() {} // This makes class abstract virtual void Complain() const = 0; protected: std::string m_Name; // name of offending employee} ;// Derived class used to complain about overpaid employeesclass OverpaidException : public EmpException {public: OverpaidException( std::string name, double salary ); OverpaidException( const OverpaidException& e ); ~OverpaidException() {} // Outputs specific complaint void Complain() const; private: double m_Salary; // excessive yearly salary} ;// Derived class used to complain about hourly employees// who don't work enough hours per weekclass LazyException : public EmpException {public: LazyException( std::string name, int hours ); LazyException( const LazyException& e ); ~LazyException() {} // Outputs specific complaint void Complain() const; private: int m_Hours; // Hours offending employee works per week} ;#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -