-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
69 lines (52 loc) · 2.06 KB
/
Copy pathEmployee.java
File metadata and controls
69 lines (52 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
public abstract class Employee {
private static int countID; //static , so ti can accumulate the number of employees
public String name;
public int employeeID;
public double baseSalary;
public double bonus;
public Employee manager;
public Accountant accountantSupport;
public int headcount=0;
public double bonusBudget;
public Employee(String name, double baseSalary){
//Should construct a new employee object and take in two parameters,
// one for the name of the user and one for their base salary.
this.name=name;
this.baseSalary=baseSalary;
countID++;
this.employeeID=countID;
}
public double getBaseSalary(){
return this.baseSalary;//Should return the employee's current salary
}
public String getName(){
return this.name; //Should return the employee's current name
}
public int getEmployeeID(){
//Should return the employee's ID.
// The ID should be issued on behalf of the employee at the time they are constructed.
// The first ever employee should have an ID of "1", the second "2" and so on
return this.employeeID;
}
public Employee getManager(){
return manager;//Should return a reference to the Employee object that represents this employee's manager
}
public Accountant getAccountantSupport() {
return accountantSupport;
}
public void setManager(Employee manager){
this.manager=manager;
}
public boolean equals(Employee other){
//Should return true if the two employee IDs are the same, false otherwise
return this.getEmployeeID()==other.getEmployeeID();
}
public String toString(){
//Should return a String representation of the employee that is a combination of their id followed by their name.
// Example: "1 Kasey"
return getEmployeeID()+" "+getName();
}
public abstract String employeeStatus();
public void getBonus(){
}
}