Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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;

}

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions