-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContestant.java
More file actions
47 lines (37 loc) · 763 Bytes
/
Contestant.java
File metadata and controls
47 lines (37 loc) · 763 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
43
44
45
46
47
public class Contestant{
private String _name;
private Score _myScore;
private int _numRounds;
public Contestant(){
_name = "Bob";
_myScore = new Score();
_numRounds = 0;
}
public Contestant(String name){
this();
_name = name;
}
public int getScore(){
return _myScore.getScore();
}
public void addScore(){
_myScore.add();
}
public void subtractScore(){
_myScore.subtract();
}
public String getName(){
return _name;
}
public int getNumRounds(){
return _numRounds;
}
public void setNumRounds(int num){
_numRounds = num;
}
public String changeName(String newName){
String temp = _name;
_name = newName;
return temp;
}
}