Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago