C++高级编程:第一个有用的C++程序(不带用户界面)

C++高级编程:第一个有用的C++程序(不带用户界面)
#include <iostream>
#include <string>
#include <vector>
#include <stdexcept>

namespace Records
{
	constexpr int kDefaultStartingSalary = 30000;

	class Employee
	{
	public:
		Employee() :
			mFirstName(""),
			mLastName(""),
			mEmployeeNumber(-1),
			mSalary(kDefaultStartingSalary),
			mHired(false)
		{}
		void promote(int raiseAmount = 1000)
		{
			setSalary(getSalary() + raiseAmount);
		}
		void demote(int demeritAmount = 1000)
		{
			setSalary(getSalary() - demeritAmount);
		}
		void hire()
		{
			mHired = true;
		}
		void fire()
		{
			mHired = false;
		}
		void display() const
		{
			std::cout << "Employee: " << getLastName() << ", " << getFirstName() << std::endl;
			std::cout << "------------------------------" << std::endl;
			std::cout << (mHired ? "Current Employee" : "Former Employee&