← 返回资讯屏轩教育 · 行业资讯

A-Level Edexcel Programming: Operators, Expressions and Control Flow | A-Level Edexcel 编程:运算符、表达式与控制流

2026-08-29 15:30 · 本文部分内容由AI辅助创作

📚 A-Level Edexcel Programming: Operators, Expressions and Control Flow | A-Level Edexcel 编程:运算符、表达式与控制流

In Edexcel A-Level Computer Science, programming questions test your ability to trace, write and correct pseudocode. Operators, expressions and control flow form the foundation of nearly every algorithm you will encounter on Paper 1 and in the practical programming project.

在 Edexcel A-Level 计算机科学考试中,编程题考查跟踪、编写和纠正伪代码的能力。运算符、表达式和控制流是你在 Paper 1 和编程项目中几乎所有算法的基础。


1. Data Types and Variables | 数据类型与变量

Before using any operator, you must know the data type of each operand. Edexcel pseudocode uses five core types: integer, real, Boolean, character and string.

在使用任何运算符之前,你必须知道每个操作数的数据类型。Edexcel 伪代码使用五种核心类型:整数、实数、布尔、字符和字符串。

Variables must be declared with a clear data type. A common exam mistake is mixing types, such as trying to add an integer to a string without converting first.

变量必须声明清楚的数据类型。常见考试错误是混合类型,例如未先转换就将整数与字符串相加。


2. Arithmetic Operators | 算术运算符

Arithmetic operators allow you to perform calculations on numeric data. Edexcel includes the standard operators plus integer division and modulo.

算术运算符允许你对数值数据执行计算。Edexcel 包括标准运算符以及整数除法和取模运算。

OperatorMeaningExample
+Addition5 + 3 = 8
-Subtraction5 - 3 = 2
*Multiplication5 * 3 = 15
/Division (real result)5 / 2 = 2.5
DIVInteger division5 DIV 2 = 2
MODRemainder after division5 MOD 2 = 1

Be careful with DIV and MOD when negative numbers are involved. In Edexcel pseudocode, DIV truncates towards zero, and MOD gives the remainder with the sign of the dividend.

当涉及负数时,使用 DIV 和 MOD 要小心。在 Edexcel 伪代码中,DIV 向零截断,MOD 给出带被除数符号的余数。


3. Relational and Comparison Operators | 关系与比较运算符

Comparison operators return a Boolean result and are essential for building conditions in selection and iteration.

比较运算符返回布尔结果,并且在选择和迭代中构建条件时必不可少。

When comparing strings, the comparison is typically based on lexicographic order using the character set's collating sequence. For example, "apple" < "banana" because 'a' comes before 'b'.

比较字符串时,通常根据字符集的排序序列按字典顺序比较。例如,"apple" < "banana",因为 'a' 在 'b' 之前。


广告 / Sponsored

4. Boolean Operators: AND, OR, NOT | 布尔运算符:AND、OR、NOT

Boolean operators combine or invert logical values. You must know their truth tables and how short-circuit evaluation works in pseudocode.

布尔运算符组合或反转逻辑值。你必须了解它们的真值表以及伪代码中短路求值的工作原理。

ABA AND BA OR BNOT A
TRUETRUETRUETRUEFALSE
TRUEFALSEFALSETRUEFALSE
FALSETRUE
广告 / Sponsored
必刷题2027高中教材划重点数学物理化学生物必修一二1高一高二上2026下册语文英语历史政治选修234高中必刷题教材同…
化学、物理 备考教辅 · 正版现货 · 学习备考通用
查看详情 / View on Taobao参考价 ¥10.82
广告 / Sponsored
2026新初中必刷题八年级上册下册物理数学语文英语历史生物地理道法狂k重点八上人教版教材同步练习册试卷初中必刷题狂K重…
地理、物理 备考教辅 · 正版现货 · 学习备考通用
查看详情 / View on Taobao参考价 ¥16.84

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao