Глава 22. Обработка исключительных ситуаций __ 619
void SetState(const strings strNewState)
{ strState = strNewState; } void SetZip(unsigned long NewZip)
{ Zip = NewZip; } void SetNumExpenses(unsigned NewNumExpenses)
{ NumExpenses = NewNumExpenses; }
unsigned GetID() const { return EmployeeID; } string GetFirstNameO const { return strFirstName; } char GetMiddleInitial() const { return Middlelnitial; } string GetLastName() const { return strLastName; } string GetAddressO const { return strAddress; } string GetCityO const { return strCity; } string GetStateO const { return strState; } unsigned long GetZipl) const { return Zip; } unsigned GetNumExpenses() const { return NumExpenses; }
private:
unsigned EmployeeID;
string strFirstName; *
char Middlelnitial;
string strLastName;
string strAddress;
string strCity;
string strState;
unsigned long Zip;
unsigned NumExpenses;
);
ostreams operator«(ostreams ostr, const Employees employee);
istreams operator»(istreams istr. Employees employee);
#endif
В листинге 22.26 определены недостающие методы класса Employee.
.// Необходимые заголовки #include <employee.h>
Employee::Employee() :
EmployeeID(0), Middlelnitial('\0'), Zip(OUL) , NumExpenses(0)
ostreams operator«(ostreams ostr, const Employees employee) {
ostr « employee.Get ID();
ostr « employee.GetFirstName() « " ";
ostr « employee.GetLastName() « " ";