-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdministrator.java
60 lines (51 loc) · 1.14 KB
/
Administrator.java
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
package assignment2016UniPeopleManagementQUESTION;
/**
* Administrator class inherits the Person class
*
* @author user
*
*/
public class Administrator extends Person {
/**
* variable for the jobtitle
*/
private String jobtitle;
/**
* constructor for the name, age and the jobtitle of the person super()
* constructor with parameters inherited from the parent class
*
* @param name
* @param age
* @param jobtitle
*/
Administrator(String name, int age, String jobtitle) {
super(name, age);
setJobtitle(jobtitle);
}
/**
* method to see the jobtitle of the person if bad input terminates the
* program
*
* @return the jobtitle of the person
*/
public String getJobtitle() {
return jobtitle;
}
/**
* method to set the job of the person
*
* @param jt
*/
public void setJobtitle(String jt) {
if (verifyWords(jt)) {
jobtitle = jt;
}
}
/**
* method toString() and to print out the information about that
* administrator
*/
public String toString() {
return getName() + " " + getAge() + " " + getID() + " " + getJobtitle();
}
}