瀏覽代碼

Second ReadMe

Ian 10 年之前
父節點
當前提交
8cf99d601b
共有 1 個檔案被更改,包括 26 行新增20 行删除
  1. 26
    20
      README.md

+ 26
- 20
README.md 查看文件

1
 #Input Validation in Objects
1
 #Input Validation in Objects
2
 
2
 
3
-## Introduction
3
+##Introduction
4
 
4
 
5
 It is important to check all input. A program input can be used to delete or damage data, obtain sensitive information or propogate worms. All input must be threated as potentially dangerous.
5
 It is important to check all input. A program input can be used to delete or damage data, obtain sensitive information or propogate worms. All input must be threated as potentially dangerous.
6
 
6
 
10
 
10
 
11
 The program that you will be editing is a Basketball Statistics Tracker.
11
 The program that you will be editing is a Basketball Statistics Tracker.
12
 To understand the program you will need to learn basketball point system.
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
+*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
22
 
22
 
23
 Note that these variables are declared private, and they are unsigned short.
23
 Note that these variables are declared private, and they are unsigned short.
24
 Remember that unsigned short does not have negative numbers.
24
 Remember that unsigned short does not have negative numbers.
27
 
27
 
28
 **Instructions**
28
 **Instructions**
29
 1. In `BPlayer.cpp`, add input validation in:
29
 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();`
30
+	*`void remPoints();`
31
+	*`void remReb();`
32
+	*`void remAst();`
33
+	*`void remStl();`
34
+	*`void remBlock();`
35
+	*`void remFoul();`
36
+	*`void remTurnover();`
37
 2. Run and verify that it works.
37
 2. Run and verify that it works.
38
 3. In `BPlayerClient.cpp`,
38
 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.
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
+---
44
+
45
+##References:
46
+
47
+ [1] http://cis1.towson.edu/~cssecinj/modules/cs0/input-validation-cs0-c/