Question: 1.Base class employee question below code public class Employee { private String name; private int idNumber; private String department; private String position; /** * no

1.Base class employee question below code

public class Employee {

private String name;

private int idNumber;

private String department;

private String position;

/** * no argument constructor */ public Employee() { }

/** * argument constructor * * @param name * * @param idNumber * * @param department * * @param position * */

public Employee(String name, int idNumber, String department, String position) {

this.name = name;

this.idNumber = idNumber;

this.department = department;

this.position = position;

}

// getters and setters

/** * * @return name * */

public String getName() {

return name;

}

/** * * @return idNumber * */

public int getIdNumber() {

return idNumber;

}

/** * * @return department * */

public String getDepartment() {

return department;

}

/** * * @return position * */

public String getPosition() {

return position;

}

/** * * @param name * */

public void setName(String name) {

this.name = name;

}

/** * * @param idNumber * */

public void setIdNumber(int idNumber) {

this.idNumber = idNumber;

}

/** * * @param department * */

public void setDepartment(String department) {

this.department = department;

}

/** * * @param position * */

public void setPosition(String position) {

this.position = position;

}

/* * (non-Javadoc) * * @see java.lang.Object#toString() * */

public String toString() {

return "Name: " + name + ", ID: " + idNumber + ", Department: " + department + ", and Job Title: " + position;

}

}

Code the following ADTs (classes), making sure to follow the instructions in the bulleted lists. Draw the resulting inheritance hierarchy.

Write a derived class named ProductionWorker that extends base class Employee

and has the following fields:

shift (1=day shift; 2=night shift)

hourly pay rate

and the appropriate constructor/getter/setter/toString methods

Include Javadoc comments for the class and every method

Create a separate Java application to unit test this class (zyBook section 6.6) by creating 2 objects.

The shift supervisor is a salaried employee who supervises a shift. In addition to receiving a salary, the supervisor earns a yearly bonus when his/her shift meets production goals. Write derived class ShiftSupervisor that extends base class Employeeand has the following fields:

annual salary

annual bonus

and the appropriate constructor/getter/setter/toString methods:

Include Javadoc comments for the class and every method

Use the same Java application created in step 1. to unit test this class by creating 2 objects (one that earns a bonus and one that does not).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!