11.1 Programming Basics 编程基础简答
Review the exact wording students need for this knowledge point, then open a filtered question list when ready to practise.
Find questions for 9618-AS-11-01Scope
本页只整理 basic operations、operators、expressions 和 built-in functions 的理解与错误解释。完整 pseudocode implementation 留到专项。
Basic programming operations
- Declaration:introduces an identifier and its data type。
- Initialisation:assigns a starting value before use。
- Assignment:stores the evaluated right-hand value in an identifier。
- Input/output:receives data or presents/writes a result。
- Expression:combines values, identifiers, functions and operators to produce one value。
Type compatibility
Expression and assignment must use compatible types:
- Arithmetic operators require numeric operands。
&concatenates CHAR/STRING values;it is not numeric addition。- Logical operators AND/OR/NOT require Boolean operands/results。
- Comparisons produce BOOLEAN。
- A STRING cannot be added numerically to an INTEGER without conversion。
Error explanation pattern
不要只写 “wrong operator”。写明 required type 和 actual type:
INT(x / 2)returns an INTEGER, so it cannot be used as a Boolean operand withAND.
Built-in functions
Built-in/library routines perform common operations that do not need to be rewritten。考试会提供未在 pseudocode guide 中规定的 functions。
理解 function expression 时依次检查:
- Number and type of parameters。
- Return data type。
- Index/position conventions for string extraction。
- Whether explicit conversion is needed。
常见 categories:string length/extraction/case conversion;numeric conversion/rounding;character-code conversion;date day/month/year;random values。
Evaluating expressions
- Work from inner function calls outward。
- Record the data type after each operation。
- Apply arithmetic precedence and brackets。
- For Boolean expressions, evaluate comparisons before AND/OR/NOT as defined。
- Keep quotation marks conceptually:
"12"is STRING, while12is INTEGER。
Describing an algorithm without code
需要 detailed description 时仍应包含 variables、initial values、input loop、conditions、updates and final output。用自然语言顺序描述,不写 pseudocode keywords when prohibited。
Exam checklist
- Assignment 与 comparison 是否区分?
- Operator operands 是否类型匹配?
- Function parameter 与 return type 是否匹配?
- 字符串连接是否使用 string operation,而不是 arithmetic?
- Explain error 是否写清 expected/actual type?
Declaration、assignment、function calls 和完整 algorithm pseudocode 将在代码专项中练习。
Practice This Knowledge Point
Open the question bank with this knowledge code already filled in. The filtered list will show matching questions for this note.
Open filtered practice