Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Employee and ProductionWorker Classes Design an Employee class that has fields f

ID: 3917184 • Letter: E

Question

                             Employee and ProductionWorker Classes

Design an Employee class that has fields for the following pieces of information:

Employee name
Employee number

Next, design a class named ProductionWorker that extends the Employee class. The ProductionWorker class should have fields to hold the following information:

Shift number (an integer, such as 1, 2, or 3)
Hourly pay rate

The workday is divided into two shifts: day and night. The shift field will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Design the appropriate accessor and mutator methods for each class.

Once you have designed the classes, design a program that creates an object of the ProductionWorker class and prompts the user to enter data for each of the object’s fields. Store the data in the object and then use the object’s accessor methods to retrieve it and display it on the screen.

Answer must be in pseudocode, Not Java, Not Python, etc.

Explanation / Answer

class Employee //Attributes declaration String employeeName Integer employeeNumber //Method definitions //Mutators setName(String name) employeeName = name setNumber(Integer number) employeeNumber = number //Accessors getName() return employeeName getNumber() return employeeNumber endClass //Class derived from Employee class ProductionWorker extend Employee //Attributes declaration Integer shiftNumber Float payRate //Method definitions //Mutators setShiftNumber(Integer shift) shiftNumber = shift setPayRate(Float pay) PayRate = pay //Accessors getShiftNumber() return shiftNumber getPayRate() return payRate endClass //Start of main program START ProductionWorker P //Declaration of ProductionWorker class object String name Integer number, shift Float pay //Input data output "Enter employee name: " input name P.setName(name) output "Enter employee number: " input number P.setNumber(number) output "Enter employee shift number: " input shift P.setShiftNumber(shift) output "Enter employee hourly pay rate: " input pay P.setPayRate(pay) //Display data output "Employee name: ", P.getName() output "Employee number: ", P.getNumber() output "Employee shift: ", P.getShiftNumber() output "Employee hourly pay rate: ", P.getPayRate() END

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote