Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ven the Employee class and the Lawyer class above Write an employee class SoftwareEngineer to accompany the other em- ployees. SoftwareEngineers work 10 more hours

image text in transcribed

ven the Employee class and the Lawyer class above Write an employee class SoftwareEngineer to accompany the other em- ployees. SoftwareEngineers work 10 more hours (50 hours/week), they make $55,000 (S15,000 more than others), they get half as much vacation (only 5 days), and they have an additional method named writeCode that prints "Coding! Use the super keyword to interact with the Employee su perclass as appropriate a) public class Employee public int getHours) public double getsalaryO public int getVacationDaysO public string getvacationFormO b) Write an employee class HarvardLanyer to accompany the other em- return 40 // works 40 hours/week ployees. 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 nor- mal Laxyer's vacation form ever changed, the HarvardLawyer's should as well. For example, if Lawyez's vacation form changed to "zed", the Haz- vardLawyez's should return "zedredred") Use the auper keyword to in teract with the Lawyer superclass as appropriate. return 40000.0 $40,000.00/ year return 10 // 2 weeks' paid vacation c) Write a client class called EmployeeClient that creates objects of La return "ye1low"use the yellow form yex, SofcwareEngineer and HardvardLawyer class in the main method. Write a method called printEmployee 0 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 print ing a SoftwareEngineer object. Call printEmployeeO method from main method Example output for Lawyer object Lawyer Salary: $40000 Hours: 40 Vacation days: 15 Vacation form: pink public class Lawyer extends Employee t public int getVacationDays public string getvacationFormO public void sue ) return super.getVacationDays 0+5 return "pink" System.out.println("I'11 see you in court)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Is the Ratio test conclusive for the p-series P n

Answered: 1 week ago

Question

Understand the roles of signs, symbols, and artifacts.

Answered: 1 week ago

Question

Discuss the key ambient conditions and their effects on customers.

Answered: 1 week ago

Question

Be familiar with the integrative servicescape model.

Answered: 1 week ago