Share
Explore BrainMass

Employee Production Worker Program

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

* Employee Name
* Employee Number

Also 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.

After having 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. Please provide a Flowchart, and a Pseudocode following the guidelines of good
program design, like meaningful variable names and thoroughly commented code.

After having 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. Please provide a Flowchart, and a Pseudocode following the guidelines of good program design, like meaningful variable names and thoroughly commented code.

Solution Preview

Please see attached document for the complete solution (flowchart and pseudocode).

Program Pseudocode

//Class Employee
Begin Employee Class
//Initialize Class variables
Initialize EmployeeName
Initialize EmployeeNumber
//Initialize Class methods
Initialize setEmployeeName (name)
Initialize setEmployeeNumber (num)
Initialize getEmployeeName ()
Initialize getEmployeeNumber ()
End Employee Class

Begin Employee::setEmployeeName(name) Method
EmployeeName = name //Set employee name to Employee Name variable
Return //Return to the main program
End Employee::setEmployeeName(name) Method

Begin Employee::setEmployeeNumber(num) Method
EmployeeNumber = name //Set employee number to Employee Number variable
Return //Return to the main ...

Solution Summary

This posting contains the pseudocode and flowchart required.

$2.19