|
@@ -10,15 +10,16 @@ Classes can use public and private member variables. In this lab you will learn
|
10
|
10
|
|
11
|
11
|
The program that you will be editing is a Basketball Statistics Tracker.
|
12
|
12
|
To understand the program you will need to learn basketball point system.
|
13
|
|
-*Free throw - counts 1 point
|
14
|
|
-*Field goal - counts 2 points
|
15
|
|
-*Three point - counts 3 points
|
16
|
|
-*Rebounds - add 1
|
17
|
|
-*Assist - add 1
|
18
|
|
-*Steals - add 1
|
19
|
|
-*Blocks - add 1
|
20
|
|
-*Fouls - add 1
|
21
|
|
-*Turnovers - add 1
|
|
13
|
+
|
|
14
|
+* Free throw - counts 1 point
|
|
15
|
+* Field goal - counts 2 points
|
|
16
|
+* Three point - counts 3 points
|
|
17
|
+* Rebounds - add 1
|
|
18
|
+* Assist - add 1
|
|
19
|
+* Steals - add 1
|
|
20
|
+* Blocks - add 1
|
|
21
|
+* Fouls - add 1
|
|
22
|
+* Turnovers - add 1
|
22
|
23
|
|
23
|
24
|
Note that these variables are declared private, and they are unsigned short.
|
24
|
25
|
Remember that unsigned short does not have negative numbers.
|
|
@@ -27,18 +28,21 @@ The program lets the user add or remove stats. You will need to implement a syst
|
27
|
28
|
|
28
|
29
|
**Instructions**
|
29
|
30
|
1. In `BPlayer.cpp`, add input validation in:
|
30
|
|
- *`void remPoints();`
|
31
|
|
- *`void remReb();`
|
32
|
|
- *`void remAst();`
|
33
|
|
- *`void remStl();`
|
34
|
|
- *`void remBlock();`
|
35
|
|
- *`void remFoul();`
|
36
|
|
- *`void remTurnover();`
|
|
31
|
+
|
|
32
|
+ * void remPoints()
|
|
33
|
+ * void remReb()
|
|
34
|
+ * void remAst()
|
|
35
|
+ * void remStl()
|
|
36
|
+ * void remBlock()
|
|
37
|
+ * void remFoul()
|
|
38
|
+ * void remTurnover()
|
|
39
|
+
|
37
|
40
|
2. Run and verify that it works.
|
38
|
41
|
3. In `BPlayerClient.cpp`,
|
39
|
|
- *In the function `void options(vector<BPlayer> &team, int &game)`, add input validation
|
40
|
|
- *Validate that the user never enters negative numbers
|
41
|
|
- *Validate that the user selects a team between 1 and 15.
|
|
42
|
+
|
|
43
|
+ * In the function `void options(vector<BPlayer> &team, int &game)`, add input validation
|
|
44
|
+ * Validate that the user never enters negative numbers
|
|
45
|
+ * Validate that the user selects a team between 1 and 15.
|
42
|
46
|
|
43
|
47
|
---
|
44
|
48
|
|