Question: include #include #include ProductionWorker.h using namespace std; void displayInfo(Productionworker); int main() { try { Productionworker pw(John Jones, 123, 1/1/2006, 3, 18.00); } catch(Productionworker::Invalidshift) { cout

include #include #include "ProductionWorker.h" using namespace std; void displayInfo(Productionworker); int main() { try { Productionworker pw("John Jones", "123", "1/1/2006", 3, 18.00); } catch(Productionworker::Invalidshift) { cout << "Invalid shift"; } displayInfo(pw); cin.get(); return 0; } I'm making a class though I have pw not declared and Invalid shift does not name a type. Please help me

Productionworker.h:

#ifndef PRODUCTIONWORKER_H

#define PRODUCTIONWORKER_H

#include "Employee.h"

using namespace std;

#include

class Productionworker : public Employee

{

private:

int shift;

double payRate;

public:

class invalidShift

{};

Productionworker() : Employee()

{ shift = 0 ; payRate = 0.0;

}

Productionworker (string cName, string cNumber, string cDate, int cShift,

double cPayRate):Employee ( cName, cNumber, cDate)

{ shift = cShift; cDate; cPayRate; }

void setShift(int s)

{ shift = s;

}

void setpayRate(double r)

{ payRate = r;

}

int getShiftNumber() const

{ return shift;

}

string getShiftName() const

{

if (shift == 1)

return "Day";

else if (shift == 2)

return "Night";

else

throw invalidShift();

}

double getPayRate() const

{

return payRate;

}

};

#endif

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!