Write a Java program that uses decorator classes to add capabilities to employees.
Write a Java program that uses decorator classes to add capabilities to employees. In a typical company, an employee will be asked to perform a number of duties, such as Department Head, Safety Coordinator, Recruiter, or Community Liason. You should have additional ones besides those. Your Java program will create Employees and then decorate these employees at runtime.
Create an abstract class named Employee, with last name and description fields, and a getDescription() method.
Create a concrete class named SalariedEmployee that extends Employee.
Create an abstract class named ResponsibilityDecorator that is able to decorate an employee and return the employee’s responsibility as a string. It will have an abstract getDescription method.
Create some job category classes that extend the ResponsibilityDecorator class and implement the getDescription() method.
In your main test program, create at least 5 Employee objects and pass them to the constructors of each of your decorator classes.
The first employee should be you so use your last name.
Then, print each Employee by calling its getDescription() method.
All employees should not have the same number of responsibilities.
The program’s output should look something like this for each employee :
Picture of the output for a single employee.
Of course, you print the person’s name where the “[LastName]” placeholder is shown. The brackets should not be included.
Submission (2 Points)
Submit a ZIP file called FirstnameLastnamelab6.zip containing only Java source files. Do not use the package statement in any of your files.
Each class should be in a separate file.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.