Answered step by step
Verified Expert Solution
Link Copied!

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?
image text in transcribed
image text in transcribed
How to Submit You need to submit java files to appropriate submission folder on iCollege. Submit a text document with an answer to the question (d) public class Employee public int getHours) // works 40 hours week return 40; public double getsalary) 7 $40,000.00/year return 40000.0; public int getVacationDays // 2 weeks' paid vacation return 10; public String getVacationForm) // use the yellow form return "yellow" public class Lawyer extends Employee( public int getVacationDays) return super.getVacationDays) +5; public String getVacationForm) return "pink": public void sue System.out.println("I'11 see you in court!") Given the Employee class and the Lawyer class above Write an employee class Programmer to accompany the other employees. Programmers work normal hours (40 hours/week), they make $70,000 (S25,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..." 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 "). 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. a. b. c. 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

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

Persuading Your Audience Strategies for

Answered: 1 week ago