Answer:
Step-by-step explanation:
public class Employee{
//Existing employee code
public String getName(){
return Name;
}
public double getSalary(){
return salary;
}
public int getId(){
return id;
}
public void setName(String name){
this.name = name;
}
//Manager Class
public class Manager extends Employee{
private double bonus;
public Manager(int id,String name,double salary,double bonus){
super(id,name,salary);
this.bonus = bonus;
}
public void setBonus(double bonus){
this.bonus = bonus;
}
public double getBonus(){
return bonus;
}
}
//Regular Class
public class Regular extends Employee{
private double overtime;
public Manager(int id,String name,double salary,double overtime){
super(id,name,salary);
this.overtime = overtime;
}
public void setOvertime(double overtime){
this.overtime = overtime;
}
public double getOvertime(){
return overtime;
}
}