⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 emp_exceptions.h

📁 斯坦福Energy211/CME211课《c++编程——地球科学科学家和工程师》的课件
💻 H
字号:
// 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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -