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

Programming Operators and Expressions | 编程运算符与表达式

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

📚 Programming Operators and Expressions | 编程运算符与表达式

In Edexcel A-Level Computer Science, programming questions often depend on your ability to read, write and evaluate expressions built from operators. Understanding how arithmetic, comparison, Boolean and assignment operators behave is essential for tracing algorithms and writing correct pseudocode.

在 Edexcel A-Level 计算机科学中,编程题往往取决于你能否阅读、编写和计算由运算符构成的表达式。理解算术、比较、布尔和赋值运算符的行为对于追踪算法和写出正确的伪代码至关重要。


1. What Are Operators? | 什么是运算符?

An operator is a symbol or keyword that performs an operation on one or more operands. For example, in 5 + 3, the plus sign is an operator and 5 and 3 are operands.

运算符是对一个或多个操作数执行操作的符号或关键字。例如,在 5 + 3 中,加号是运算符,5 和 3 是操作数。

Operators allow programmers to combine values, compare them, make decisions and manipulate data within expressions.

运算符使程序员能够在表达式中组合数值、进行比较、做出判断和处理数据。


2. Arithmetic Operators | 算术运算符

The basic arithmetic operators are addition (+), subtraction (−), multiplication (*), division (/), integer division (DIV) and modulus (MOD). Most languages use * for multiplication and / for real division.

基本算术运算符包括加号(+)、减号(−)、乘号(*)、除法(/)、整数除法(DIV)和取模(MOD)。大多数语言用 * 表示乘法,用 / 表示实数除法。

OperatorMeaningExampleResult
+Addition7 + 29
−Subtraction7 − 25
*Multiplication7 * 214
/Real division7 / 23.5
DIVInteger division7 DIV 23
MODRemainder7 MOD 21

The table above gives the common arithmetic operations. Edexcel pseudocode uses DIV and MOD to handle integer division and remainders.

上表列出了常见的算术运算。Edexcel 伪代码使用 DIV 和 MOD 处理整数除法和余数。


3. Integer Division and Modulus | 整数除法与取模运算

DIV gives the whole-number part of a division, discarding any remainder. MOD gives only the remainder after whole-number division.

DIV 给出除法的整数部分,舍弃任何余数。MOD 只给出整数除法后的余数。

17 DIV 5 = 3 and 17 MOD 5 = 2 because 17 = 5 × 3 + 2

digit extraction and circular indexing. For example, n MOD 2 = 0 checks whether n is even.

这些运算在关于奇偶判断、取位和循环索引的问题中非常常见。例如,n MOD 2 = 0 可以判断 n 是否为偶数。


广告 / Sponsored

4. Comparison Operators | 比较运算符

ss than), > (greater than), ≤ (less than or equal to) and ≥ (greater than or equal to).

比较运算符比较两个值并返回布尔结果:TRUE 或 FALSE。常用的有 =(等于)、≠(不等于)、<(小于)、>(大于)、≤(小于等于)和 ≥(大于等于)。

excel pseudocode, the not-equal sign is often written as <> or ≠. Some languages use != instead.

在 Edexcel 伪代码中,不等号常写作 <> 或 ≠。有些语言使用 !=。

OperatorMeaningExample that returns TRUE
=equal to4 = 4
≠ or <>not equal to4 ≠ 5
<less than3 < 8
>greater than9 > 2
≤less than or equal to5 ≤ 5
≥greater than or equal to7 ≥ 6

5. Boolean Operators | 布尔逻辑运算符

Boolean operators combine Boolean values. The three fundamental operations are AND, OR and NOT. AND returns TRUE only when both operands are TRUE; OR returns TRUE when at least one operand is TRUE; NOT reverses a single Boolean value.

布尔运算符用于组合布尔值。三种基本运算是 AND、OR 和 NOT。AND 仅在两个操作数都为 TRUE 时返回 TRUE;OR 在至少一个操作数为 TRUE 时返回 TRUE;NOT 对单一布尔值取反。

Truth tables are essential for tracing conditions. For example, (age

Published by TutorHao | A-Level 编程 Revision Series | aleveler.com

广告 / Sponsored
现货正版:创新创业教育(高职高专新商科教材) 9787302576310 清华大学出版社 苏燕,关勇,孟秀锦,刘h伶,…
商科 备考教辅 · 正版现货 · 学习备考通用
查看详情 / View on Taobao参考价 ¥23.03
广告 / Sponsored
Cambridge International AS & A Level Literature in English …
英语 备考教辅 · 正版现货 · 学习备考通用
查看详情 / View on Taobao参考价 ¥419.0

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

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