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.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 1CP: In previous chapters, you have created programs for the Greenville Idol competition. Now create a...
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning