Question: Please answer the following question by understanding the above programs. Please refer to the code in the Appendix (pages 2 - 6) to answer the

 Please answer the following question by understanding the above programs. Pleaserefer to the code in the Appendix (pages 2 - 6) toanswer the following questions. 1. What is the relationship between the Employeeclass and the Manager class? What concept does this demonstrate? (10 points)

Please answer the following question by understanding the above programs.

Please refer to the code in the Appendix (pages 2 - 6) to answer the following questions.

1. What is the relationship between the Employee class and the Manager class? What concept does this demonstrate? (10 points)

2. What would happen if mySalary were declared private instead of protected? (15 points)

3. Review, upload, compile and run the code in Repl.it. Write the output for each section of print statements. (15 points)

4. Which raiseSalary() method does m.raiseSalary(10) execute? Why? What concept does this demonstrate? (20 points)

5. Which raiseSalary() method does e1.raiseSalary(10) execute? Why? What concept does this demonstrate? (20 points)

6. Which raiseSalary() method does e2.raiseSalary(10,1) execute? Why? What concept does this demonstrate? (20 points)

APPENDIX Traits.java public interface Traits public String getName(); public String getTitle(); } Employee.java public class Employee implements Traits { private String myName; private String myTitle; protected double mySalary: private int myAge; public Employee (String name, String title, double salary, int age) { myName = name; myTitle - title; mySalary = salary: myAge - age; } public String getName() { return myName; } public String getTitle() { return myTitle; 1 public double getSalary() { return mySalary; 1 public int getAge() { return myage; } public void raiseSalary(int percent) { mySalary = mySalary + 0.95 * percent * 0.01 * mySalary; } public void raiseSalary(int percent, int cost_of_living_adjustment) { mySalary = mySalary + 0.95 * percent * 0.01 * mySalary + cost_of_living_adjustment. 0.01 * mysalary; Manager.java public class Manager extends Employee private int yearsWorked; private String highest Degree; private double promotionBonus; public Manager (String name, String title, double salary, int age, int experience, String degree, double bonus) { super (name, title, salary, age); yearsWorked = experience; highest Degree = degree; promotionBonus - bonus; public int getExperience () { return yearsWorked; public String getDegree () { return highest Degree; } public double get Bonus () { return promotionBonus; } public void raiseSalary(int percent) { mySalary = mySalary + 0.95 * percent * 0.01 * mySalary + promotionBonus; public class Testi public static void main(String args) { Manager m = new Manager ("John Doe", "Department Head", 100000.0, 54, 31, "PhD", 5000.0); Employee el = new Employee ("Jane Doe", "Resource Analyst", 75000.0, 41); Employee e2 = new Employee ("Jim Doe", "Engineer", 85000.0, 45); . . + m.getName()); " + m.getTitle()); + m.getAge()); " + 11 . . 11 . + m.getDegree()); + m.getSalary(); + m.getBonus()); . " + m.getSalary()); System.out.println("Name System.out.println("Title System.out.println("Age System.out.println("Years of Experience m.getExperience()); System.out.println("Highest Degree Earned : System.out.println("Salary System.out.println("Promotion Bonus m.raiseSalary(10); System.out.println("Salary Raised!"); System.out.println("New Salary System.out.println(" "); System.out.println("Name System.out.println("Title System.out.println("Age System.out.println("Salary el.raiseSalary(10); System.out.println("Salary Raised"); System.out.println("New Salary System.out.println(" "); 11 . . + el.getName()); " + el.getTitle()); " + el.getAge()); " + el.getSalary()); 11 + el.getSalary()); . System.out.println("Name System.out.println("Title System.out.println("Age System.out.println("Salary e2.raiseSalary(10,1); System.out.println("Salary Raised"); System.out.println("New Salary " + e2.getNam " + e2.getTitle()); " + e2.getAge()); " + e2.getSalary() ); " + e2.getSalary() )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!