Write an employee class Marketer to accompany the other law

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

Solution

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.\") ;
}
}

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 employee

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site