Question: Sample Interactive Session In the sample data that follows, what the user types is shown in bold. In actuality, what the user types would appear

Sample Interactive Session
In the sample data that follows, what the user types is shown in bold. In actuality, what the user types would
appear as the same text format as the rest of the output.
////////////////////////////////////////
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.h
// Specification file for the Employee class
#ifndef EMPLOYEE_H
#define EMPLOYEE_H
#include
using namespace std;
class Employee
{
private:
static int lastEmployeeNumberIssued; // Sequential employee number
int employeeNumber; // Employee number for current employee
string employeeName; // Employee name
string hireDate; // Hire date
public:
// Constructors
Employee();
Employee(string aName, string aDate);
// Mutators
void setEmployeeName(string n);
void setHireDate(string date);
// Accessors
string getEmployeeName() const;
int getEmployeeNumber() const;
string getHireDate() const;
static int getLastEmployeeNumberIssued();
};
#endif
//////////////////////////////////////////////////
ProductionWorker.h
// Specification file for the ProductionWorker Class
#ifndef PRODUCTION_WORKER_H
#define PRODUCTION_WORKER_H
#include
#include
#include
#include "Employee.h"
using namespace std;
class ProductionWorker : public Employee
{
private:
int shift; // The worker's shift
double payRate; // The worker's hourly pay rate
public:
// Default constructor
ProductionWorker() : Employee(){
shift =0; payRate =0.0;
}
// Constructor
ProductionWorker(string aName, string aDate, int aShift, double aPayRate)
: Employee(aName, aDate){
shift = aShift; payRate = aPayRate;
}
// Mutators
void setShift(int s);
void setPayRate(double r);
static ProductionWorker *createNewProductionWorker();
// Accessors
int getShiftNumber() const;
string getShiftName() const;
double getPayRate() const;
void printWorkerData() const;
};
#endif
Sample Interactive Session In the sample data

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 Programming Questions!