omplete #1,2,3 . Please submit just one file for the classes and main to test the classes. Just create the classes before main . Do not create separate header files. Use code below as your base. The Employee and Production Worker are in the code below. They satisfy #1 Employee and ProductionWorker Classes. #include

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

C++ Visual studio 2019 

Complete #1,2,3 . Please submit just one file for the classes and main to test the classes. Just create the classes before main . Do not create separate header files. Use code below as your base. The Employee and Production Worker are in the code below. They satisfy #1 Employee and ProductionWorker Classes.

#include <string>
#include <iostream>
#include <iomanip>
using namespace std;

class Employee
{
private:
    string name;        // Employee name
    string number;        // Employee number
    string hireDate;    // Hire date

public:
    // Default constructor
    Employee()
    {
        name = ""; number = ""; hireDate = "";
    }

    // Constructor
    Employee(string aName, string aNumber, string aDate)
    {
        name = aName; number = aNumber; hireDate = aDate;
    }

    // Mutators
    void setName(string n)
    {
        name = n;
    }

    void setNumber(string num)
    {
        number = num;
    }

    void setHireDate(string date)
    {
        hireDate = date;
    }

    // Accessors
    string getName() const
    {
        return name;
    }

    string getNumber() const
    {
        return number;
    }

    string getHireDate() const
    {
        return hireDate;
    }
};


// Specification for the ProductionWorker Class

#include <string>
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 aNumber, string aDate,
        int aShift, double aPayRate) : Employee(aName, aNumber, aDate)
    {
        shift = aShift; payRate = aPayRate;
    }

    // Mutators
    void setShift(int s)
    {
        shift = s;
    }

    void setPayRate(double r)
    {
        payRate = r;
    }

    // Accessors
    int getShiftNumber() const
    {
        return shift;
    }

    string getShiftName() const
    {
        if (shift == 1)
            return "Day";
        else if (shift == 2)
            return "Night";
        else
            return "Invalid";
    }
    double getPayRate() const
    {
        return payRate;
    }
};


// Employee and ProductionWorker classes
// Function prototype
void displayInfo(ProductionWorker);

int main()
{
    ProductionWorker pw("John Jones", "123", "10/12/2010", 2, 18.00);
    displayInfo(pw);
    return 0;
}

//******************************************************
// The displayInfo function displays a production      *
// worker's employment information.                    *
//******************************************************
void displayInfo(ProductionWorker e)
{
    cout << setprecision(2) << fixed << showpoint;
    cout << "Name: "
        << e.getName() << endl;
    cout << "Employee number: "
        << e.getNumber() << endl;
    cout << "Hire date: "
        << e.getHireDate() << endl;
    cout << "Shift: "
        << e.getShiftName() << endl;
    cout << "Shift number: "
        << e.getShiftNumber() << endl;
    cout << "Pay rate: "
        << e.getPayRate() << endl;
}

1. Employee and ProductionWorker
Classes
Design a class named Employee. The class should keep the following information:
Employee name
Employee number
•
• Hire date
E
Write one or more constructors, and the appropriate accessor and mutator functions,
for the class.
Transcribed Image Text:1. Employee and ProductionWorker Classes Design a class named Employee. The class should keep the following information: Employee name Employee number • • Hire date E Write one or more constructors, and the appropriate accessor and mutator functions, for the class.
The ProductionWorker class should have member variables to hold the following
Next, write a class named ProductionWorker that is derived from the Employee class.
information:
• Shift (an integer)
• Hourly pay rate (a double)
integer value representing the shift that the employee works. The day shift is shift 1,
The workday is divided into two shifts: day and night. The shift variable will hold an
and the night shift is shift 2. Write one or more constructors, and the appropriate acces-
sor and mutator functions, for the class. Demonstrate the classes by writing a program
that uses a ProductionWorker object.
2. ShiftSupervisor Class
In a particular factory, a shift supervisor is a salaried employee who supervises a shift. In
addition to a salary, the shift supervisor earns a yearly bonus when his or her shift meet
production goals. Design a Shift Supervisor class that is derived from the Employee class
you created in Programming Challenge 1 (Employee and Production Worker Classes). The
ShiftSupervisor class should have a member variable that holds the annual salary, and a
member variable that holds the annual production bonus that a shift supervisor has earned.
Write one or more constructors and the appropriate accessor and mutator functions for the
class. Demonstrate the class by writing a program that uses a ShiftSupervisor object.
3. TeamLeader Class
In a particular factory, a team leader is an hourly paid production worker who leads
a small team. In addition to hourly pay, team leaders earn a fixed monthly bonus.
Team leaders are required to attend a minimum number of hours of training per year.
Design a Team Leader class that extends the ProductionWorker class you designed in
Programming Challenge 1 (Employee and Production Worker Classes). The Team Leader
class should have member variables for the monthly bonus amount, the required number
of training hours, and the number of training hours that the team leader has attended.
Write one or more constructors and the appropriate accessor and mutator functions for
the class. Demonstrate the class by writing a program that uses a Team Leader object.
Transcribed Image Text:The ProductionWorker class should have member variables to hold the following Next, write a class named ProductionWorker that is derived from the Employee class. information: • Shift (an integer) • Hourly pay rate (a double) integer value representing the shift that the employee works. The day shift is shift 1, The workday is divided into two shifts: day and night. The shift variable will hold an and the night shift is shift 2. Write one or more constructors, and the appropriate acces- sor and mutator functions, for the class. Demonstrate the classes by writing a program that uses a ProductionWorker object. 2. ShiftSupervisor Class In a particular factory, a shift supervisor is a salaried employee who supervises a shift. In addition to a salary, the shift supervisor earns a yearly bonus when his or her shift meet production goals. Design a Shift Supervisor class that is derived from the Employee class you created in Programming Challenge 1 (Employee and Production Worker Classes). The ShiftSupervisor class should have a member variable that holds the annual salary, and a member variable that holds the annual production bonus that a shift supervisor has earned. Write one or more constructors and the appropriate accessor and mutator functions for the class. Demonstrate the class by writing a program that uses a ShiftSupervisor object. 3. TeamLeader Class In a particular factory, a team leader is an hourly paid production worker who leads a small team. In addition to hourly pay, team leaders earn a fixed monthly bonus. Team leaders are required to attend a minimum number of hours of training per year. Design a Team Leader class that extends the ProductionWorker class you designed in Programming Challenge 1 (Employee and Production Worker Classes). The Team Leader class should have member variables for the monthly bonus amount, the required number of training hours, and the number of training hours that the team leader has attended. Write one or more constructors and the appropriate accessor and mutator functions for the class. Demonstrate the class by writing a program that uses a Team Leader object.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Study of Characters
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education