blob: 4b0b86eccf6d46d908992d07d5a6412fb5d780e4 (
plain)
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
|
package Q8;
public class Point {
public static final int PLAYER1 = 0;
public static final int PLAYER2 = 1;
private int player;
private int score;
private String stroke;
public Point(int player, String stroke, int score) {
this.player = player;
this.stroke = stroke;
this.score = score;
}
public int getPlayer() {
return this.player;
}
public int getScore() {
return this.score;
}
public String getStroke() {
switch (this.stroke) {
case "a":
return "slice";
case "b":
return "drive";
case "c":
return "smash";
case "d":
return "drop";
case "e":
return "net-shot";
default:
return "unknown";
}
}
}
|