设计
引入本课内容
| English | 释义 | 拼音 |
|---|---|---|
| validation/ˌvælɪˈdeɪʃn/ | 有效性检查 | yǒu xiào xìng jiǎn chá |
| coding/ˈkəʊdɪŋ/ | 编码 | biān mǎ |
| data type/ˈdeɪtə taɪp/ | 数据类型 | shù jù lèi xíng |
| Boolean/ˈbuːlɪən/ | 布尔型 | bù ěr xíng |
| field length | 字段长度 | zì duàn cháng dù |
| check digit/tʃek ˈdɪdʒɪt/ | 校验位 | jiào yàn wèi |
| range check/reɪndʒ tʃek/ | 范围检查 | fàn wéi jiǎn chá |
| type check/taɪp tʃek/ | 类型检查 | lèi xíng jiǎn chá |
| data capture form | 数据采集表 | shù jù cǎi jí biǎo |
Plan every field
- Design decides the file structure, the validation 有效性检查 and the layouts before anything is built.
Fields and coding 编码
| decide | example |
|---|---|
| field name | Date_of_birth |
| data type 数据类型 | text, integer, decimal, date, Boolean 布尔型, currency |
| field length 字段长度 | Postcode: 8 |
- Coding: M/F, S/M/L. Saves space, speeds entry, eases validation; codes must be learned and detail can be lost.
What is an advantage of coding data, such as M and F?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Codes must be learned, and detail can be lost.
Validation
- Validation checks data is reasonable, not that it is correct.
| check | example |
|---|---|
| range | 0–100 |
| length | 8+ characters |
| type | age is a number |
| character | no digits in a name |
| format | DD/MM/YYYY |
| presence | not empty |
| check digit 校验位 | last digit of a bar code |
Shoe_size: whole sizes 1–13. Type integer; range check 范围检查 1 ≤ size ≤ 13; type check 类型检查.
Match each validation check to an example.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Each check tests a different property.
Validation checks that data is correct.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
It checks that data is reasonable and sensible, not correct.
Which check uses an extra digit calculated from the others?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Used on bar codes and ISBNs.
Input and output formats
- Data capture forms 数据采集表: title, instructions, labelled boxes, drop-downs and tick boxes, logical order.
- Screen and report layouts: headings, clear fonts, spacing, only what is needed.
Which features make a good on-screen data capture form?
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Clarity, not decoration.
A range check needs both limits. "Mark must be ≥ 0" alone lets 150 through.
Design each field's name, data type and length; use coding to save space; choose validation checks to keep data sensible; design clear forms and layouts.
出了什么问题?只有网站团队能看到这些信息。