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

ShiftSupervisor Class Design a class named Employee. this class should keep the

ID: 3835084 • Letter: S

Question

ShiftSupervisor Class
Design a class named Employee. this class should keep the following information in fields:
Employee name Employee number in the format XXX-L, where each X is a digit within the range 0-9 and the L is a letter within the range A-M. Hire date Write one or more constructors and appropriate accessor and mutator methods for the class.
A shift supervisor is a salaried employee who supervises a shift. In addition to salary, the shift supervisor earns a yearly bonus whtn his or her shift meets the production goals. Design a ShiftSupervisor class that extends the Employee class you created above. The ShiftSupervisor class should have a field that holds the annual salary and a field that holds the annual production bonus that the shift supervisor has earned. Write one or more constructors and the appropriate accessor (getters) and mutator (setters) methods for the class.
Demonstrate the class by writing a program that uses a ShiftSupervisor object.
Sample Output: Here's the first shift supervisor. Name: John Smith Employee Number: 123-A Hire Date: 11-15-2005 Annual Salary: $48,000.00 Production Bonus: $6,500.00 Here's the second shift supervisor. Name: Joan Jones Employee Number: 222-L Hire Date: 12-12-2005 Annual Salary: $55,000.00 Production Bonus: $8,000.00 Press any key to continue . . . ShiftSupervisor Class
Design a class named Employee. this class should keep the following information in fields:
Employee name Employee number in the format XXX-L, where each X is a digit within the range 0-9 and the L is a letter within the range A-M. Hire date Write one or more constructors and appropriate accessor and mutator methods for the class.
A shift supervisor is a salaried employee who supervises a shift. In addition to salary, the shift supervisor earns a yearly bonus whtn his or her shift meets the production goals. Design a ShiftSupervisor class that extends the Employee class you created above. The ShiftSupervisor class should have a field that holds the annual salary and a field that holds the annual production bonus that the shift supervisor has earned. Write one or more constructors and the appropriate accessor (getters) and mutator (setters) methods for the class.
Demonstrate the class by writing a program that uses a ShiftSupervisor object.
Sample Output: Here's the first shift supervisor. Name: John Smith Employee Number: 123-A Hire Date: 11-15-2005 Annual Salary: $48,000.00 Production Bonus: $6,500.00 Here's the second shift supervisor. Name: Joan Jones Employee Number: 222-L Hire Date: 12-12-2005 Annual Salary: $55,000.00 Production Bonus: $8,000.00 Press any key to continue . . . ShiftSupervisor Class
Design a class named Employee. this class should keep the following information in fields:
Employee name Employee number in the format XXX-L, where each X is a digit within the range 0-9 and the L is a letter within the range A-M. Hire date Write one or more constructors and appropriate accessor and mutator methods for the class.
A shift supervisor is a salaried employee who supervises a shift. In addition to salary, the shift supervisor earns a yearly bonus whtn his or her shift meets the production goals. Design a ShiftSupervisor class that extends the Employee class you created above. The ShiftSupervisor class should have a field that holds the annual salary and a field that holds the annual production bonus that the shift supervisor has earned. Write one or more constructors and the appropriate accessor (getters) and mutator (setters) methods for the class.
Demonstrate the class by writing a program that uses a ShiftSupervisor object.
Sample Output: Here's the first shift supervisor. Name: John Smith Employee Number: 123-A Hire Date: 11-15-2005 Annual Salary: $48,000.00 Production Bonus: $6,500.00 Here's the second shift supervisor. Name: Joan Jones Employee Number: 222-L Hire Date: 12-12-2005 Annual Salary: $55,000.00 Production Bonus: $8,000.00 Press any key to continue . . .

Explanation / Answer

PROGRAM CODE:

Employee.java

package array;

public class Employee {

   private String name;

   private String employeeNumber;

   private String hireDate;

  

   Employee()

   {

       employeeNumber = "XXX-L";

       hireDate = "";

   }

  

   Employee(String name, String number, String date)

   {

       this.name = name;

       employeeNumber = number;

       hireDate = date;

   }

   public String getEmployeeNumber() {

       return employeeNumber;

   }

   public void setEmployeeNumber(String employeeNumber) {

       this.employeeNumber = employeeNumber;

   }

   public String getHireDate() {

       return hireDate;

   }

   public void setHireDate(String hireDate) {

       this.hireDate = hireDate;

   }

  

   @Override

   public String toString() {

       return "Name: " + name + " Employee Number: " + employeeNumber + " Hire Date: " + hireDate;

   }

}

ShiftSupervisor.java

package array;

public class ShiftSupervisor extends Employee{

  

   double salary;

   double bonus;

  

   public ShiftSupervisor(String name, String number, String date, double sal) {

       super(name, number, date);

       salary = sal;

   }

   public double getSalary() {

       return salary;

   }

   public void setSalary(double salary) {

       this.salary = salary;

   }

   public double getBonus() {

       return bonus;

   }

   public void setBonus(double bonus) {

       this.bonus = bonus;

   }

  

   @Override

   public String toString() {

       return super.toString() + " Annual Salary: $" + salary + " Production Bonus: $" + bonus;

   }

}

ShiftSupervisorTester.java

package array;

public class ShiftSupervisorTester {

   public static void main(String[] args) {

       ShiftSupervisor shiftsupervisor1 = new ShiftSupervisor("John Smith", "123-A", "11-15-2005", 48000.00);

       ShiftSupervisor shiftsupervisor2 = new ShiftSupervisor("Joan Jones", "222-L", "12-12-2005", 55000.00);

       shiftsupervisor1.setBonus(6500.00);

       shiftsupervisor2.setBonus(8000.00);

       System.out.println(shiftsupervisor1);

       System.out.println(shiftsupervisor2);

   }

}

OUTPUT:

Name: John Smith

Employee Number: 123-A

Hire Date: 11-15-2005

Annual Salary: $48000.0

Production Bonus: $6500.0

Name: Joan Jones

Employee Number: 222-L

Hire Date: 12-12-2005

Annual Salary: $55000.0

Production Bonus: $8000.0

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