Question: For the base public class Person example provided in the Unit 3 Revisiting the Employee Class Program tutorial, what if you need to add a

For the base public class Person example provided in the Unit 3 Revisiting the Employee Class Program tutorial, what if you need to add a subclass for Auditors who have a host employee and are auditing a specific department of the company?
What code segment could implement this subpublic class and create an instance of it called auditor_1?
public class Auditor extends Person {
private String host;
private String department;
public Auditor(String firstName,String lastName,String jobTitle,String host, String department){
super(firstName,lastName,jobTitle);
this.host = host;
this.department = department;
}
public String getHost(){
return "Host "+ this.host;
}
public void setHost(String newhost){
this.host = newhost;
}
public String getDepartment(){
return "Department Auditing "+ this.department;
}
public void setDepartment(String department){
this.department = department;
}
}
Auditor auditor_1= new Auditor("John","Doe","Auditor","Jane Doe","Information Technology");
public class Auditor extends Person {
private String host;
private String department;
public Auditor(String firstName,String lastName,String jobTitle,String host, String department){
super();
this.host = host;
this.department = department;
}
public String getHost(){
return "Host "+ this.host;
}
public void setHost(String newhost){
this.host = newhost;
}
public String getDepartment(){
return "Department Auditing "+ this.department;
}
public void setDepartment(String department){
this.department = department;
}
}
Auditor auditor_1= new Auditor("John","Doe","Auditor","Jane Doe","Information Technology");
public class Auditor extends Person {
private String host;
private String department;
public Auditor(String firstName,String lastName,String jobTitle,String host, String department){
super(firstName,lastName,jobTitle,host,department);
this.host = host;
this.department = department;
}
public String getHost(){
return "Host "+ this.host;
}
public void setHost(String newhost){
this.host = newhost;
}
public String getDepartment(){
return "Department Auditing "+ this.department;
}
public void setDepartment(String department){
this.department = department;
}
}
Auditor auditor_1= new Auditor("John","Doe","Auditor","Jane Doe","Information Technology");
public class Auditor {
private String host;
private String department;
public Auditor(String firstName,String lastName,String jobTitle,String host, String department){
super(firstName,lastName,jobTitle);
this.host = host;
this.department = department;
}
public String getHost(){
return "Host "+ this.host;
}
public void setHost(String newhost){
this.host = newhost;
}
public String getDepartment(){
return "Department Auditing "+ this.department;
}
public void setDepartment(String department){
this.department = department;
}
}
Auditor auditor_1= new Auditor("John","Doe","Auditor","Jane Doe","Informatio

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!