
Project 2
Create the following as a GUI program for a production factory.
Create an
Employee class that has attributes and
properties for the following:
Employee Name
Employee Number
Weekly Salary
And an abstract method for the following:
Calculate Pay
Next, create a class named Production Worker Class that is derived from the Employee class. The Production Worker should have attributes and properties to hold the following data:
Shift Number
Hourly Pay Rate
Hours Worked
The workday is divided into two shifts: day and night. The Shift property 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. This class should include a polymorphic method to calculate pay that pays night shift employees time and one half their rate of pay.
Then, create a Team Leader Class that inherits from Production Worker. In addition to hourly pay, Team Leaders are given a weekly bonus of 10% of their weekly salary if their team's weekly production meets goal. The polymorphic method to calculate pay for the Team Leader should include this, based on a yes/no response on the user interface. As such, the Team leader will also contain an attribute and property for:
Weekly Goal Met
Create an GUI application that creates instances of object Production Worker and Team Leader and lets the user enter data for each of the objects' properties. The user should be able to invoke the calculate pay. Your interface should also enable the user to retrieve the object's attributes and display their values. Employee number should be a static variable that is incremented as you choose. As part of your solution, use a data structure to store each instance of employee so that each can be revisited after new ones are created.
You have creative control over the interface design. You may also include additional functionality for extra credit. Remember to implement good interface design as discussed in class, as well as exception handling.