Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an employee class Marketer to accompany the other law firm cla sses descri

ID: 3774797 • Letter: W

Question

Write an employee class Marketer to accompany the other law firm cla sses described in this chapter . Marketers make $50,000 ($10,000 more than general employees), and they have an additional method named advertise that prints "Act now, while supplies last!".

2. Write an employee class Janitor to accompany the other law firm classes . Janitors work twice as many hours (80 hours/week), they make $30,000 ($10,000 less than others), they get half as much vacation (only 5 days), and they have an additional method named clean that prints "Workin' for the man." .

Must be in Java

Explanation / Answer

1)

public class Marketer extends Employee {   

   @Override
   public double getSalary() {
return super.getSalary() + 10000;
}
  
public void advertise() {
System.out.println("Act now, while supplies last!") ;
}
}

2)

public class Janitor extends Employee {   

   @Override
   public double getHours() {
return super.getHours()*2;
}

   @Override
   public double getSalary() {
return super.getSalary() - 10000;
}
  
   @Override
   public double getVacationDays() {
return super.getVacationDays()/2;
}
  
public void clean() {
System.out.println("Workin' for the man.") ;
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote