Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the classes Employee, PermanentEmployee, and TemporaryEmployee such that the class Employee acts as the base class for the other two classes. Add members &

Create the classes Employee, PermanentEmployee, and TemporaryEmployee such that the class Employee acts as the base class for the other two classes. Add members & methods to the base class as specified below: The base class should contain EmployeeName, EmployeeID along with an abstract method called as calcNetSalary() to calculate net salary. The class PermanentEmployee should contain data members for storing BasicPay, HRAPercent, DAPercent, PFPercent. Provide definition for the abstract method calcNetSalary() to calculate monthly netsalary on basis of the data given above. The class TemporaryEmployee should contain data members for storing HourlyWages, HoursWorked. Provide definition for the abstract method calcNetSalary() to calculate monthly wages on basis of the data given above. Create another class called EmployeeManagement. In this class create 2 ArrayList to store the objects of permanentEmployee and temporaryEmployee class. Create methods to perform the following activities: - Add_Permanent_Employee() - this method should receive a permanentEmployee class object and insert it into first array list. - Add_Temporary_Employee() - this method should receive a temporaryEmployee class object and insert it into the second array list. - Search this method should accept an EmployeeID and searches for it in both of the array list. Note: (initialize both the arraylist with 5 records). Create a frame window with 2 radio buttons (permanent and temporary). Permanent In case of pressing this radio button, get the permanent employee details. Temporary - In case of pressing this radio button, get the temporary employee details. Similarly create 8 Text fields Name, EmployeeID, BPay, HRA, DA, PF, HourlyWages and HoursWorked to accept the corresponding input values from the user. Also create 1 text area component to display the employee details. Create 7 buttons namely Add, Search, Display, MoveFirst, MovePrevious, MoveNext, and MoveLast. Add - button is used to read the information from the GUI and pass this information to the appropriate array list (based on the radio button selection). While pressing this button if any data is missing, then throw the user-defined exception NullFieldException. Similarly, throw the user-defined exception HumanRightsViolationException in case if the HoursWorked > 200 hours. Search read the employeeID and pass this to search method of EmployeeManagment class. If found, then display the employee details in the textarea component. Display display all the employee details in the textarea component. MoveFirst, MovePrevious, MoveNext, MoveLast buttons perform the navigation appropriately based on the selected employee type (radio buttons) and display the same in the textarea component.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems analysis and design

Authors: kenneth e. kendall, julie e. kendall

8th Edition

135094909, 013608916X, 9780135094907, 978-0136089162

More Books

Students also viewed these Programming questions