Question: Java We have written the following abstract Department class abstract class Department { // instance variable protected int numEmployees; // abstract instance method declaration public
We have written the following abstract Department class abstract class Department { // instance variable protected int numEmployees; // abstract instance method declaration public abstract String getRole(); // non-abstract instance method definition public int getNumEmployees() { return this.numEmployees; // non-abstract static method definition public static double getWeeklySalary(double salary, double hours) { return salary * hours; TASK: Create two classes, HumanResources and ResearchDevelopment, that have the following properties: Both classes should extend the Department abstract class The Human Resources class should have a one-parameter constructor that sets the numEmployees instance variable. It should also implement the getRole instance method to return the following: "Role is to handle payroll" The ResearchDevelopment class should have a one-parameter constructor that sets the numEmployees instance variable. It should also reimplement ("hide") the getWeeklySalary static method such that it returns 1.1 * salary * hours. It should also implement the getRole instance method to return the following: "Role is to do research and development
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
