public class EmployeeExaminer
public static void Main()
Manager manager_1 = new Manager();
Manager manager_2 = new Manager();
Executive exec_1 = new Executive();
Executive exec_2 = new Executive();
manager_1.setSalary("70,000");
manager_1.setName("Tom");
manager_1.setEmployeeCount("50");
manager_1.setDepartment("HR");
Console.WriteLine(manager_1.toString());
manager_2.setSalary("70,000");
manager_2.setName("Tom");
manager_2.setEmployeeCount("50");
manager_2.setDepartment("HR");
Console.WriteLine(manager_1.equals(manager_2));
exec_1.setSalary("250,000");
exec_1.setEmployeeCount("200");
Console.WriteLine(exec_1.toString());
exec_2.setSalary("250,000");
exec_2.setEmployeeCount("200");
Console.WriteLine(exec_1.equals(exec_2));
public void setName(string personName)
public void setSalary(string employeeSalary)
public string getSalary()
private string department;
private string employeeCount;
public void setDepartment(string companyDepartment)
department = companyDepartment;
public string getDepartment()
public void setEmployeeCount(string count)
public string getEmployeeCount()
return "Name: " + base.getName() + " Salary: $" + getSalary() + " Department: " + getDepartment() + " Employee Count: " + getEmployeeCount();
public bool equals(Object otherObject)
Manager other = (Manager)otherObject;
return getDepartment().Equals(other.getDepartment()) && getEmployeeCount().Equals(other.getEmployeeCount()) && getName().Equals(other.getName()) && getSalary().Equals(other.getSalary());
class Executive : Manager
public void setRole(string execRole)
return "Role: " + role + "Name: " + getName() + " Salary: $" + getSalary() + " Department: " + getDepartment() + " Employee Count: " + getEmployeeCount();
new public bool equals(Object otherObject)
Executive other = (Executive)otherObject;
return getRole().Equals(other.getRole()) && getDepartment().Equals(other.getDepartment()) && getEmployeeCount().Equals(other.getEmployeeCount()) && getName().Equals(other.getName()) && base.getSalary().Equals(other.getDepartment());