Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the Employee class and the Lawyer class above a. Write an employee class Programmer to accompany the other employees. Programmers work normal hours (40
Given the Employee class and the Lawyer class above
a. Write an employee class Programmer to accompany the other employees. Programmers work normal hours (40 hours/week), they make $70,000 ($25,000 more than others), they get 10 days of vacation and have an ability to write code. (You need to implement an appropriate method; the implementation should only contain a print statement that yields Writing code...).
b. Write an employee class SeniorProgrammer to accompany the other employees. Software engineers make 25% more money than programmers, they get 4 days more vacation, and they are also capable of leading meetings (You need to implement an appropriate method; the implementation should only contain a print statement that yields Leading a meeting...).
c. Write a client class called EmployeeMain that creates objects of Programmer and SeniorProgrammer and Lawyer classes in the main method. Write a method called printEmployee() 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 a Programmer object is being printed out, and call
leadMeeting() if a SeniorProgrammer object is being printed out. Call printEmployee() method from main method for both objects.
Note: please remember that the best way to efficiently print out information about an object is to implement the toString() method.
Example output for Lawyer object
Lawyer:
Salary: $40000 Hours: 40
Vacation days: 15 Vacation form: pink
d. Submit an answer to the following question. Why is it possible to have one
printEmployee() method for different types of employees?
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