Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1.Which are projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

What are the classifications of Bank?

Answered: 1 week ago