Question: Employee.cpp // Implementation file for the Employee class #include Employee.h #include using namespace std; int Employee::lastEmployeeNumberIssued=0; // Sequential employee number // Default constructor Employee::Employee() {

Employee.cpp

// Implementation file for the Employee class

#include "Employee.h"

#include

using namespace std;

int Employee::lastEmployeeNumberIssued=0; // Sequential employee number

// Default constructor

Employee::Employee()

{

lastEmployeeNumberIssued++;

employeeNumber = lastEmployeeNumberIssued;

employeeName = "";

hireDate = "";

}

// Constructor

Employee::Employee(string aName, string aDate)

{

lastEmployeeNumberIssued++;

employeeNumber = lastEmployeeNumberIssued;

employeeName = aName;

hireDate = aDate;

}

// Mutators

void Employee::setEmployeeName(string n)

{

employeeName = n;

}

void Employee::setHireDate(string date)

{

hireDate = date;

}

// Accessors

string Employee::getEmployeeName() const

{

return employeeName;

}

int Employee::getEmployeeNumber() const

{

return employeeNumber;

}

string Employee::getHireDate() const

{

return hireDate;

}

int Employee::getLastEmployeeNumberIssued()

{

return lastEmployeeNumberIssued;

}

Employee.cpp // Implementation file for the Employee class #include "Employee.h" #include using

Employee Class Modify the Employee class: Add an exception class: Add code to the Employee class to check if hire date string object fits the numeric format. One easy way to accomplish this is to use the "square brackets" operator access individual characters in the hire date string: InvalidHireDate MM/DD/YYYY 1)to 1. The hire date string should have a length of 10. 2 The characters at index 2 and index 5 should be a forward-slash character ( ). 3. The characters at index 0, 1, 3, 4, 6, 7, 8, and 9 should be in the range of 0..9. (Refer to the isdigit) function in the cetype function library. You may need to adda #include statement to your program. (Refer to Chapter 10 of the textbook, or the cplusplus.com web-site.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!