?? emp_exceptions.cpp
字號:
// Implementation file for employee exception classes#include "emp_exceptions.h"#include <iostream>using namespace std;//// OverpaidException class ////// Use base class constructor to initialize nameOverpaidException::OverpaidException( string name, double salary ) : EmpException( name ) { m_Salary = salary;}// Use base class copy constructor to copy nameOverpaidException::OverpaidException( const OverpaidException& e ) : EmpException( e ) { m_Salary = e.m_Salary;}void OverpaidException::Complain() const { // Print error message saying who is paid too much, // and how overpaid they are cout << m_Name << " is not worth the $" << m_Salary << " we pay each year!" << endl;}//// LazyException class ////// Use base class constructor to initialize nameLazyException::LazyException( string name, int hours ) : EmpException( name ) { m_Hours = hours;}// Use base class copy constructor to copy nameLazyException::LazyException( const LazyException& e ) : EmpException( e ) { m_Hours = e.m_Hours;} void LazyException::Complain() const { // Print error message saying who is lazy, // and how little they work per week cout << m_Name << " is a lazy bum who only works " << m_Hours << " hours per week!" << endl;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -