Create a class Employee that has a field for storing the complete name of the employee (first and last name), a field for storing the identification number of the employee (ID), and another field for storing his salary.

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
100%

Create a class Employee that has a field for storing the complete name of the employee (first
and last name), a field for storing the identification number of the employee (ID), and another
field for storing his salary.


Provide
1. a no-argument constructor for initializing the fields to default values.
2. a 3-argument constructor for initializing the fields to values sent from outside. Use
strcpy function to copy one string into another.
3. a setter function (mutator) that sets the values of these fields by getting input from the
user.
4. an accessor function to display the values of the fields.
Derive three classes from this employee class: Manager, Scientist, and Laborer. Manager
class has an additional data member of # of subordinates. Scientist class contains additional
information about # of publications. Laborer class is just similar to the employee class. It has no
additional capabilities. Derive a class foreman from the Laborer class that has an additional
data member for storing the percentage of quotas met by a foreman. Provide appropriate
no-argument and n-argument constructors for all the classes. Provide the overridden getter and
setter functions here too to input and output all the fields. Determine whether public, private, or
protected inheritance should be used.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Developing computer interface
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