Must be in C++ and cannot come from any online source. Please include all requested parts in problem.    Create a class named Employee that has the following member variables: name - a string that holds the employee's name empIdNumber - an int variable that holds the employee's ID Number  job - a string that holds the name of the position the employee is working in (Laborer, Manager, Secretary, etc.) yearsOfService- an integer that holds the employee's years of service The class should have the following constructors: A constructor with the following values as parameter arguments and assigns them to the appropriate member variables:  employee's name, employee ID number, job and years of service that are passed to them when the object is created (pass each of the four values into the constructor) A constructor with the following values as parameter arguments and assigns them to the appropriate member variables: employee's name and ID Number. The job field should be assigned an empty string ("") and the yearsOfService should be set to 0 inside the constructor. A default constructor that assigns empty strings ("") to the name, Id number and job member variables, and 0 to the years of service member variable. Write appropriate mutator functions that store values in these member variables and accessor functions that return the values in these member variables (this will help with the final displaying of data). Once you have written the class definition in your program, create four Employee objects to hold the following data: Name:                 ID Number          Job                          Years of Service Susan Harris      47899                   Manager                      24 Johnny Smith     12345                   Laborer                        15 Jan Solomon      45278                   Secretary                       8 Harry Jones        85634                   Laborer                         0 The program should store this data in the four objects and then display the data for each employee on the screen (by using a public accessor function called by each employee object). Create one student from each of the contstructors above to demonstrate that each constructor works. You may then create the fourth student by using any of the constructors your created. You will then need to use public mutator functions to set values for objects created using the second and third constructor.

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

Must be in C++ and cannot come from any online source. Please include all requested parts in problem. 

 

  1. Create a class named Employee that has the following member variables:

    • name - a string that holds the employee's name
    • empIdNumber - an int variable that holds the employee's ID Number 
    • job - a string that holds the name of the position the employee is working in (Laborer, Manager, Secretary, etc.)
    • yearsOfService- an integer that holds the employee's years of service

    The class should have the following constructors:

    • A constructor with the following values as parameter arguments and assigns them to the appropriate member variables:  employee's name, employee ID number, job and years of service that are passed to them when the object is created (pass each of the four values into the constructor)
    • A constructor with the following values as parameter arguments and assigns them to the appropriate member variables: employee's name and ID Number. The job field should be assigned an empty string ("") and the yearsOfService should be set to 0 inside the constructor.
    • default constructor that assigns empty strings ("") to the name, Id number and job member variables, and 0 to the years of service member variable.

    Write appropriate mutator functions that store values in these member variables and accessor functions that return the values in these member variables (this will help with the final displaying of data). Once you have written the class definition in your program, create four Employee objects to hold the following data:

    Name:                 ID Number          Job                          Years of Service

    Susan Harris      47899                   Manager                      24
    Johnny Smith     12345                   Laborer                        15
    Jan Solomon      45278                   Secretary                       8
    Harry Jones        85634                   Laborer                         0

    The program should store this data in the four objects and then display the data for each employee on the screen (by using a public accessor function called by each employee object).

    Create one student from each of the contstructors above to demonstrate that each constructor works. You may then create the fourth student by using any of the constructors your created. You will then need to use public mutator functions to set values for objects created using the second and third constructor.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Class
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