- 1. Chapter 6Data Management 數據管理
- 2. Data must be carefully control becauseTo get accurate and meaningful result
To protect the computer hardware from being damaged
- 3. Sources of error (錯誤來源)Fill in error (填寫錯誤)
Transcription error (抄寫錯誤)
Input error (輸入錯誤)
- 4. How to control? Data verification (數據核對)
Data validation (數據驗證)
- 5. Data verification (數據核對)Display data to let the user check again and ask for confirm
Double check
Triple check
…….
For example : Bill Payment System, Ticket Booking System
- 6. Data validation (數據驗證)Programmer foresee possible errors and detect them and probably correct them
Presence check - This field must be filled?
Range check - Data exceed a limit?
Type check - Data type match or not?
Consistency check - Strange data appear?
Control total - total no. of record correct?
- 7. Data validation (數據驗證)Check digit
Can be found in ID card, bar codes, ISBN …
Use formula to check the data is correct or not
For example : this student ID 1234(0) correct?
Formula : Add all digit, Divide the sum by 10, Found the remainder
In this case, this is a valid (有效) ID !!
- 8. Common used checking methodWeighted modulo 11 check
Formula :
unit digit X 2
tenth digit X 3
hundredth digit X 4
:
add all, mod 11, use 11 - the remainder
- 9. HK ID. No. CheckingA237637(A)X 2X 3X 4X 5X 68141835 14 = 122122 mod 11 = 1check digit = 11 - 1 = 10X 7X 8249++++++It is valid有效!!
- 10. HK ID. No. CheckingZ297138(0)X 2X 3X 4X 5X 620814543516= 340340 mod 11 = 10check digit = 11 - 10 = 1X 7X 849++++++It is invalid無效!!