-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCrewMember.java
More file actions
42 lines (32 loc) · 806 Bytes
/
CrewMember.java
File metadata and controls
42 lines (32 loc) · 806 Bytes
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
public class CrewMember extends RacePerson
{
private int experience;
static int MIN_AGE;
static int MIN_EXPERIENCE;
public CrewMember(String name, int age, int ID,int experience) {
super(name, age, ID);
this.experience=experience;
this.MIN_AGE=20;
this.MIN_EXPERIENCE=2;
calculateSkill();
// TODO Auto-generated constructor stub
}
@Override
public boolean verifyValidity() {
if(this.age>=this.MIN_AGE && this.experience>=this.MIN_EXPERIENCE)
return true;
else
return false;
}
@Override
public void calculateSkill() {
// TODO Auto-generated method stub
this.skill= ((this.experience*100)/this.age);
}
@Override
public String getInfo() {
String s1=((RacePerson)this).toString();
String s2="Experience : "+this.experience;
return s1+"\n"+s2;
}
}