public class Employee { private int hours; private double salary; private int vacationDays; public Employee(){ this.hours = 40; this.salary = 4000e.ee; this.vacationDays = 10; Given the Employee class above, the following are your tasks a. Write methods for the Employee class getHours, getSalary and getvacationDays. b. Overload the Employee constructor with one that accepts 3 parameters namely the hours, salary and vacationDays. c. Write a Manager class (derived from Employee class) with a salary of 50,000 more than the base Employee. It also has additional attribute bonus and method setBonus that sets bonus value. d. Write a SeniorManager class (derived from Manager class) with a salary of 30,000 more than the base Manager. Its bonus and vacationDays is twice as many as the base Manager. e. Write a Janitor class (derived from Employee class) and its working hours is twice as many as base employee. Janitor employee salary is 10,000 klower than base Employee and half as much vacation days.

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

In Java Program. Thank you

1. Given the Employee class:
public class Employee {
private int hours;
private double salary;
private int vacationDays;
public Employee(){
this.hours = 40;
this.salary = 40000.ee;
this.vacationDays = 10;
Given the Employee class above, the following are your tasks
a. Write methods for the Employee class getHours, getSalary and getvacationDays.
b. Overload the Employee constructor with one that accepts 3 parameters namely the
hours, salary and vacationDays.
c. Write a Manager class (derived from Employee class) with a salary of 50,000 more
than the base Employee. It also has additional attribute bonus and method setBonus
that sets bonus value.
d. Write a SeniorManager class (derived from Manager class) with a salary of 30,000
more than the base Manager. Its bonus and vacationDays is twice as many as the
base Manager.
e. Write a Janitor class (derived from Employee class) and its working hours is twice as
many as base employee. Janitor employee salary is 10,000 lower than base Employee
and half as much vacation days.
Transcribed Image Text:1. Given the Employee class: public class Employee { private int hours; private double salary; private int vacationDays; public Employee(){ this.hours = 40; this.salary = 40000.ee; this.vacationDays = 10; Given the Employee class above, the following are your tasks a. Write methods for the Employee class getHours, getSalary and getvacationDays. b. Overload the Employee constructor with one that accepts 3 parameters namely the hours, salary and vacationDays. c. Write a Manager class (derived from Employee class) with a salary of 50,000 more than the base Employee. It also has additional attribute bonus and method setBonus that sets bonus value. d. Write a SeniorManager class (derived from Manager class) with a salary of 30,000 more than the base Manager. Its bonus and vacationDays is twice as many as the base Manager. e. Write a Janitor class (derived from Employee class) and its working hours is twice as many as base employee. Janitor employee salary is 10,000 lower than base Employee and half as much vacation days.
Expert Solution
steps

Step by step

Solved in 2 steps with 5 images

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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,