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.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter5: Making Decisions
Section: Chapter Questions
Problem 8PE
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage