: Java Class Inheritance with an abstract class   Define a class Employee with the following fields: _name, _empId, _department, _position (_title), _yearlySalary, _fullTime (a boolean: true/false) , _month , _year (time of hire)   Add constructor and properties   Define an abstract method GetBiMonthlySalary() (if the employee is paid twice a month)   Define an abstract method GetVacationTime() that returns the number of vacation time this employee would have based on time of hir

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

language: Java

Class Inheritance with an abstract class

 

Define a class Employee with the following fields: _name, _empId, _department, _position (_title), _yearlySalary, _fullTime (a boolean: true/false) , _month , _year (time of hire)

 

Add constructor and properties

 

Define an abstract method GetBiMonthlySalary() (if the employee is paid twice a month)

 

Define an abstract method GetVacationTime() that returns the number of vacation time this employee would have based on time of hire

 

 

Override the ToString() method to return a string that contains the information pertaining to an employee such as name, empId, department, and where full time or not.

 

 

Define a class HourlyEmployee that inherits from Employee.

This class should have 2 fields of its own: _hours (hours worked in half a month) and _wage (hourly wage)

Provide necessary constructor, properties and methods

 

Override the ToString() to also return the additional fields

 

Gets 3 days of vacation after first year if the employee works at least 40 hours a month.

Vacation time does not increase after that

 

Define a class SeasonalEmployee that also inherits from Employee

This is a temporary employee, who is paid on hourly basis. Make it part of the Employee class

family, by inheriting one of the above classes.

 

This class should have an additional field: _contractDuration (in month)

 

Provide necessary constructor, properties and methods

 

Gets no vacation time.

 

Also override the ToString() method

 

 

Define a class RegularEmployee (gets a yearly salary)

Provide necessary constructor, propereties and method

Rule for Vacation time: one week after first year for the next 5 years of work. Earn an extra day each year after that. After 20 years of work vacation time stays constant

 

 

 

In Form1:

Create a List of Employees

Define a method preloadEmployeeList with at least 2 employees of each type

Define a method displayEmployeeList (name, empid, bimonthsalary,vacation accrued) to a JTable

Define a method DisplayEmployeeList2. To display to a JTextArea the data returned by ToString() method.

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Class
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