Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 5-Word ding1 Heading2 Tdleb ubtle Em EmphasisnteeEStron Quote Intese Q Sultle Re Stytes Given the Employee class and the Lawyer class above a. Write
Lab 5-Word ding1 Heading2 Tdleb ubtle Em EmphasisnteeEStron Quote Intese Q Sultle Re Stytes Given the Employee class and the Lawyer class above a. Write an employee class SoftwareEngineer to accompany the other employees. SoftwareEngineers work 10 more hours(50 hours/week) they make $55,000 ($15,000 more than others), they get half as much vacation only 5 days), and they have an additional method named uriteCode that prints "Coding!" Use the super keyword to interact with the Employee superclass as appropriate. b. Write an employee class HarvardLawyer to accompany the other employees, Harvard lawyers are like normal lawyers, but they make 20% more money than a normal lawyer, they get 3 days more vacation, and they have to fill out three of the lawyer's forms to go on vacation. That is, the getVacationForm method should return "pinkpinkpink". (If the normal Lawyer's vacation form ever changed, the HarvardLauver' should as well. For example, if Lawyer's vacation form changed to "red", the HarvardLawyer's should return "redredred") Use the super keyword to interact with the Lawyer superclass as appropriate Write a client class called Employee Client that creates objects of Lawyer, SoftwareEngineer and HardvardLauyer class in the main method. Write a method called printEmplovee) that takes an object of Employee as a parameter and prints out salary, hour, vacation days and vacation form for the employee. Also call code() method if you are printing a SoftwareEngineer object. Call printEmplovee method from main method c. Example output for Lawyer object Lawyer Salary: $40000 Hours: 40 Vacation days: 15 Vacation form: pink
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started