-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPlayer.java
More file actions
58 lines (50 loc) · 1.07 KB
/
Player.java
File metadata and controls
58 lines (50 loc) · 1.07 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
/**
* The Player class allows us to create Player objects that have a name (String) and an amount of winnings (int)
*
* @author Naman/Jack/Evan
* @version December 11 2016
*/
public class Player
{
// instance variables
private String name;
private int winnings;
/**
* Constructor for objects of class Player
*/
public Player(String name)
{
this.name = name;
winnings = 0;
}
/**
* Adds or removes parsed value from player's total winnings
*
* @param int val = weight of question answered
* @return none
*/
public void setWinnings(int val)
{
winnings += val;
}
/**
* Returns player's net winnings
*
* @param none
* @return winnings = net winnings of player
*/
public int getWinnings()
{
return winnings;
}
/**
* Returns name of player
*
* @param none
* @return name
*/
public String getName()
{
return name;
}
}