📚 CAIE Year 9 Computer Science: Past Paper Deep Dive | Year 9 CAIE 计算机:历年真题深度解析
Mastering CAIE Year 9 Computer Science requires more than just understanding concepts—it demands the ability to apply them under exam conditions. This deep dive into real past paper questions reveals the patterns, common traps, and reasoning skills that top students develop. We will break down ten key topics, each illustrated with authentic question styles, so you can move from theory to confident execution.
掌握 CAIE 九年级计算机科学不仅要理解概念,还要能在考试情境下应用它们。这篇历年真题深度解析揭示了高分学生培养的模式、常见陷阱和推理技巧。我们将拆解十个关键主题,每个都用真实题型加以说明,让你从理论走向从容的实战。
1. Understanding Algorithm Design with Flowcharts | 流程图与算法设计理解
In many past papers, you are given a flowchart that describes a simple process—such as checking whether a number is even or calculating a running total. A typical Year 9 question asks: "What is the final value of variable S?" The flowchart will use familiar symbols: oval for start/stop, parallelogram for input/output, diamond for decision, and rectangle for processing. To solve these, trace through step by step with a pencil, keeping a valuation table for each variable.
在很多真题中,你会看到一个描述简单过程的流程图——比如判断一个数是否为偶数,或者计算累加和。典型的九年级题目会问:“变量 S 的最终值是多少?”流程图会使用熟悉的符号:椭圆表示开始/结束,平行四边形表示输入/输出,菱形表示判断,矩形表示处理过程。解题时,用铅笔逐步跟踪,为每个变量维护一个求值表。
For example, a flowchart might initialise S ← a loop that adds 2 to S while S < 10. After the loop, S is output. Trace: S=0 → check S<10? true → S=0+2=2 → check S<10? true → S=4 → check true → S=6 → check true → S=8 → check true → S=10 → check S<10? hecked, leading to off-by-one errors. Always write down how many times the loop body runs.
例如,一个流程图可能将 S 初始化为 0,然后进入一个循环:当 S < 10 时不断给 S 加 2。循环结束后输出 S。跟踪:S=0 → 检查 S<10? 真 → S=0+2=2 → 检查真 → S=4 → 检查真 → S=6 → 检查真 → S=8 → 检查真 → S=10 → 检查 S<10? 假 → 输出 10。许多考生忘记最后一次加是在条件重新检查前执行,导致偏差错误。一定要记下循环体执行了多少次。
Pro tip: If the flowchart contains a decision with two branches, test both paths with sample inputs. Past papers often include a tracing table to fill in, so practise writing intervening values clearly.
专家提示:如果流程图包含双分支判断,用示例输入测试两条路径。真题中经常要求填写跟踪表,因此练习清晰写出中间值。
2. Tracing and Completing Pseudocode | 跟踪与补全伪代码
Pseudocode questions appear in almost every CAIE Year 9 paper. You might be asked to list the output of a fragment or to fill in missing lines. Pseudocode uses keywords like INPUT, OUTPUT, IF … THEN … ELSE … ENDIF, and FOR … TO … NEXT. Unlike real programming languages, indentation is not always enforced, so you must follow the logical structure yourself.
几乎每份 CAIE 九年级试卷里都会出现伪代码题。你可能需要列出代码片段的输出,或补全缺失行。伪代码使用 INPUT、OUTPUT、IF … THEN … ELSE … ENDIF、FOR … TO … NEXT 等关键字。与真正的编程语言不同,缩进并非强制,所以你必须自己遵循逻辑结构。
Consider this common pattern: "A ← 5; FOR Counter ← 1 TO 3; A ← A + Counter; NEXT Counter; OUTPUT A" ounter=2, A=6+2=8; Counter=3, A=8+3=11; loop ends, output 11. The question might then ask, "How many times does the loop execute?" Answer: 3. Be careful with zero-indexed or deceptive break conditions.
考虑这个常见模式:"A ← 5; FOR Counter ← 1 TO 3; A ← A + Counter; NEXT Counter; OUTPUT A"。跟踪:Counter=1, A=5+1=6; Counter=2, A=6+2=8; Counter=3, A=8+3=11; 循环结束,输出 11。题目可能会问,“循环执行了多少次?”答:3 次。当心零索引或具有欺骗性的终止条件。
Completion tasks might present a problem like: "INPUT age; IF age __ 12 THEN OUTPUT 'Child' ELSE OUTPUT 'Adult'". The blank must be filled with a comparison operator. Since 'Child' < 12. Past papers reward precise logical equivalence. Always double-check boundary cases.
补全任务可能给出这样的问题:"INPUT age; IF age __ 12 THEN OUTPUT 'Child' ELSE OUTPUT 'Adult'"。空白处需填写比较运算符。由于“Child”对应 12 岁以下,答案是 <=11 或 <12。真题对精确的逻辑等价性有要求。务必反复检查边界情况。
3. Binary Numbers and Data Representation | 二进制与数据表示
Binary conversion is a staple of Year 9 exams. You must be able to convert between binary and denary (decimal) for numbers up to 8 bits. Past paper questions often provide a table and ask: "Convert the denary number 45 into binary." Many students lose marks by not using the correct number of bits or by misaligning place values.
二进制转换是九年级考试的必备内容。你必须能够进行 8 位以内的二进制与十进制互转。真题经常给出表格并问:“将十进制数 45 转为二进制。”许多学生因未使用正确的位数或错位权值而丢分。
ubtract 32 → remainder 13; 13 >= 8, put 1, remainder 5; 5 >= 4, put 1, remainder 1; 1 >= 2? . So binary 00101101. Leading zeros are sometimes required, so check the question wording.
方法:写出权值 128, 64, 32, 16, 8, 4, 2, 1(8 位)。对 45:45<64,64 位为 0;45>=32,置 1 并减去 32 → 余 13;13>=8,置 1,余 5;5>=4,置 1,余 1;1>=2? 否,置 0;1>=1,置 1。得到二进制 00101101。有时要求保留前导零,注意审题。
You may also see questions about binary addition and overflow errors. Adding two 8-bit numbers can produce a 9-bit result, causing an overflow if the register cannot hold it. CAIE often asks, "Explain why an overflow error occurred." The answer should mention that the sum exceeds the maximum value representable in 8 bits (255).
还可能遇到二进制加法与溢出错误题目。两个 8 位数相加可能产生 9 位结果,若寄存器容纳不下就会溢出。CAIE 常问:“解释为何发生溢出错误。”答案应指出和超过 8 位能表示的最大值(255)。
Example: 10101100₂ + 01110110₂ = 1 00100010₂ (9 bits → overflow)
示例:10101100₂ + 01110110₂ = 1 00100010₂ (9 位 → 溢出)
4. Variables, Constants and Data Types | 变量、常量与数据类型
whose value can change during execution, while a constant’s value is fixed. Typical past paper task: "Identify two variables and one constant in this code." Look for assignments where a value is set once and never changed (e.g. PI ← onstant. Values that are updated within a loop, such as a counter or total, are variables.
变量是一个命名的内存位置,其值可在执行期间改变;而常量的值是固定的。典型真题任务:“指出这段代码中的两个变量和一个常量。”寻找只被赋值一次且不再改变的值(如 PI ← 3.14159)→ 常量。在循环中被更新的值,如计数器或总和,就是变量。
UE/FALSE), Char (single character), and String (sequence of characters). A question may show: "name ← 'Alice'" and ask the data type. Answer: String. Or "flag ← TRUE" → Boolean.
数据类型也大量出现。你需要区分整型(整数)、实型/浮点型(带小数点的数)、布尔型(TRUE/FALSE)、字符型(单个字符)和字符串型(字符序列)。题目可能给出:"name ← 'Alice'",问数据类型。答案:字符串。或 "flag ← TRUE" → 布尔型。
When reading code, remember that numeric values without quotes are integers, and numbers with decimal points are reals. In pseudocode, string literals are often enclosed in single or double quotes. Past papers may ask, "State the most suitable data type for storing a student’s age." Answer: Integer, because age is usually a whole number.
阅读代码时,记住不带引号的数字是整型,带小数点的数是实型。在伪代码中,字符串字面量常放在单引号或双引号内。真题可能问:“陈述存储学生年龄最合适的数据类型。”答案:整型,因为年龄通常是整数。
5. Sequence, Selection and Iteration | 顺序、选择与迭代
Every algorithm is built from three control structures: sequence (one instruction after another), selection (IF … THEN … ELSE), and iteration (loops such as FOR, REPEAT … UNTIL, WHILE … DO). Year 9 questions often ask you to identify which structure is used, or to rewrite a given scenario using a different loop type.
每个算法都由三种控制结构构建:顺序(一条接一条的指令)、选择(IF … THEN … ELSE)和迭代(如 FOR、REPEAT … UNTIL、WHILE … DO 等循环)。九年级题目常要求识别使用了哪种结构,或用不同类型的循环改写给定场景。
For example: "Write a pseudocode algorithm that inputs 10 numbers and outputs the largest." This requires a combination: sequential input, a loop (iteration), and an IF statement (selection). The solution: Initialise Largest ← -9999 (or first input), then FOR i ← 1 TO 10: INPUT Num; IF Num > Largest THEN Largest ← Num; NEXT; OUTPUT Largest.
例如:“写一个伪代码算法,输入 10 个数字并输出最大值。”这需要组合运用:顺序输入、循环(迭代)和 IF 语句(选择)。解法:初始化 Largest ← -9999(或第一个输入),然后 FOR i ← 1 TO 10: INPUT Num; IF Num > Largest THEN Largest ← Num; NEXT; OUTPUT Largest。
Count-controlled loops (FOR) repeat a known number of times, while condition-controlled loops (WHILE, REPEAT) repeat until a condition changes. Past papers might give an error where a WHILE loop never ends—an infinite loop. You must spot when the termination condition is unreachable, such as setting X ← 0; WHILE X > 0: … (with no increase of X inside). Checking loop boundaries is a common higher-mark task.
计数控制循环(FOR)重复已知次数,而条件控制循环(WHILE, REPEAT)重复直至条件改变。真题可能给出永不结束的 WHILE 循环——无限循环。你必须识别终止条件是否不可达,例如 X ← 0; WHILE X > 0: …(内部未增加 X)。检查循环边界是常见的高分任务。
6. Basic Logic Gates and Truth Tables | 基本逻辑门与真值表
AND gate outputs 1 only when both inputs are 1. OR outputs 1 when at least one input is 1. NOT simply inverts: input 0 → output 1.
CAIE 九年级引入了与门、或门和非门。可能要求你画出符号、写出真值表,或补全给定的门电路组合。与门仅在两个输入都为 1 时输出 1。或门在至少一个输入为 1 时输出 1。非门则简单取反:输入 0 → 输出 1。
table for the whole circuit. You must work in stages: calculate AND output column, then apply NOT. So the overall function becomes a NAND gate: output is 1 except when A=1 AND B=1.
一道典型真题给出两个输入 A 和 B,先经过与门,再将输出送入非门。任务:补全整个电路的真值表。必须分阶段工作:先计算与门输出列,再应用非门。因此整体功能变为与非门:除了 A=1 且 B=1 时输出为 1,其余都为 1。(注意:这里表述应为 NAND 输出 = NOT (A AND B),所以 A=1,B=1 时 AND=1, NOT=0。需要输出是 0 除了那种情况?我再检查:A AND B 输出 1 只有 A=1,B=1。然后 NOT 把 1 变成 0,所以最终输出在 A=1,B=1 时为 0,其他情况为 1。原句正确描述为:output is 0 when A=1 AND B=1, otherwise 1。我需要调整。我会在最终文章中确保准确。)
我们可以这样写:最终输出在 A=1 AND B=1 时为 0,其余情况为 1。这就是与非行为。
In some papers, you might be given a real-world scenario: " when the temperature is high OR the oil pressure is low. Represent this with logic gates." mperature sensor (1 = high), Pressure sensor (1 = low). Warning = Temperature OR Pressure.
在某些试卷中,可能给出真实场景:“当温度高或机油压力低时,汽车警示灯亮。用逻辑门表示。”这考查你是否能将需求转化为与或连接。使用传感器作为输入:温度传感器(1=高),压力传感器(1=低)。警示 = 温度 OR 压力。
| A | B | AND | NAND |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
7. Error Detection in Simple Programs | 简单程序错误检测
missing ENDIF or NEXT, incorrect comparison operator (e.g. using < instead of <=), and infinite loop conditions. You must read the code with the examiner’s intention in mind.
调试题要求你找出伪代码中的逻辑或语法错误。常见错误包括:使用未定义的变量、缺少 ENDIF 或 NEXT、比较运算符不当(如用 < 而不是 <=),以及无限循环条件。你必须带着出题人的意图去阅读代码。
Example: "FOR i ← 1 TO 10; total ← total + i; NEXT j". The error is that the loop variable is i, but NEXT references j. The correct statement is NEXT i. Some students also forget that total is used without being initialised; it could contain a random value. However, many pseudocode contexts assume 0 or a default, but best practice is to initialise: total ← 0 before the loop.
示例:"FOR i ← 1 TO 10; total ← total + i; NEXT j"。错误是循环变量为 i,但 NEXT 用了 j。正确写法是 NEXT i。一些学生还忘记 total 未经初始化就被使用,可能包含随机值。尽管许多伪代码上下文假设为 0 或默认值,但最佳实践是在循环前初始化:total ← 0。
Another common question: "This program should count how many numbers out of 5 are positive. Identify and correct the error." The code might be: "count ← 0; FOR 5 times: INPUT n; IF n > 0 THEN count ← count + 1; NEXT". The count increment is correct, but a wrong condition (<0) would give zero count or counting negatives. Always check the logical condition matches the problem statement.
另一个常见题:“该程序应统计 5 个数中有多少个是正数。找出并改正错误。”代码可能是:"count ← 0; FOR 5 times: INPUT n; IF n > 0 THEN count ← count + 1; NEXT"。计数递增是正确的,但若条件写成 <0 则会得出零计数或只计负数。务必检查逻辑条件是否与问题描述相符。
8. Input/Output Processing and Validation | 输入/输出处理与验证
Input questions often revolve around data validation: checking that a value entered is within an acceptable range or of the correct type. A typical CAIE question: "Write pseudocode that repeatedly asks for a mark until a valid mark between 0 and 100 is entered." This requires a REPEAT … UNTIL loop or a WHILE loop with a condition.
输入类题目常围绕数据验证:检查输入的值是否在可接受范围内或为正确类型。典型的 CAIE 题目:“写一段伪代码,反复要求输入成绩,直到输入一个 0 到 100 之间的有效成绩。”这需要一个 REPEAT … UNTIL 循环或带条件的 WHILE 循环。
ark >= 0 AND mark <= 100. Using WHILE: INPUT mark; WHILE mark < 0 OR mark > 100 DO; OUTPUT "Invalid, re-enter" e, but you must include the initial input before the WHILE condition check if using WHILE.
使用 REPEAT 的解法:REPEAT; INPUT mark; UNTIL mark >= 0 AND mark <= 100。使用 WHILE:INPUT mark; WHILE mark < 0 OR mark > 100 DO; OUTPUT "Invalid, re-enter"; INPUT mark; ENDWHILE。两种均可,但若用 WHILE,必须在条件检查前有一次初始输入。
Output formatting may also appear: "Output the message 'The average is ' followed by the calculated average, rounded to one decimal place." In pseudocode, you can write OUTPUT "The average is ", ROUND(avg, 1) or simply describe. Understanding how to concatenate strings with numbers is tested. Often marks are lost when students forget to convert numbers to strings implicitly, though in pseudocode it is usually assumed.
输出格式也可能出现:“输出信息 ‘The average is ’,后跟计算的平均值,保留一位小数。”在伪代码中,可以写 OUTPUT "The average is ", ROUND(avg, 1) 或直接描述。测试如何将字符串与数字拼接。常有学生因忘记隐式转换数字而丢分,不过在伪代码中通常默认允许。
9. Computer Networks and Security Basics | 计算机网络与安全基础
Year 9 CAIE papers include questions about network types (LAN, WAN), the internet as a network of networks, and simple security measures. You may be asked: "State one advantage of a LAN." Answer: "Allows sharing of resources such as printers and files." Or "Explain what is meant by a firewall." A firewall monitors and controls incoming and outgoing network traffic based on predetermined security rules.
九年级 CAIE 试卷包含网络类型(LAN、WAN)、互联网作为网络的网络,以及简单的安全措施等问题。可能问:“说明 LAN 的一个优点。”答案:“允许共享打印机和文件等资源。”或“解释防火墙的含义。”防火墙根据预设安全规则监控并控制进出网络流量。
Past papers often feature a scenario of a school network. They might ask how passwords help keep data secure: they authenticate users and restrict unauthorised access. However, they must be strong (mix of letters, numbers, symbols) to prevent brute-force attacks. A follow-up might ask for another method: encryption scrambles data so that even if intercepted, it cannot be read without the key.
真题常出现学校网络的场景。可能问密码如何帮助保护数据:它们认证用户并限制未授权访问。但密码必须强(字母、数字、符号混合)以防止暴力破解。后续可能问另一种方法:加密扰乱数据,即使被截获,没有密钥也无法读取。
You might also see questions about phishing and malware. A classic definition: "Phishing is a social engineering attack where a user is tricked into revealing personal information by pretending to be a trustworthy entity." Linking terminology to simple examples (e.g., fake emails asking for bank details) often earns full marks.
你可能还会看到关于网络钓鱼和恶意软件的问题。经典定义:“网络钓鱼是一种社会工程攻击,通过冒充可信任实体诱骗用户泄露个人信息。”将术语与简单示例(如索取银行信息的虚假邮件)联系起来通常能得满分。
10. Database Queries and Sorting Algorithms | 数据库查询与排序算法
Although databases are more prominent at IGCSE, some Year 9 past papers introduce simple query concepts. You might be given a small table of students (Name, Age, Grade) and asked: "Write a query to select all students older than 13." Using pseudocode: SELECT * FROM Students WHERE Age > 13. Or you might explain that a database uses fields, records, and primary keys.
虽然数据库在 IGCSE 中更突出,但部分九年级真题会引入简单的查询概念。可能给你一个学生小表格(姓名、年龄、成绩),并问:“写一个查询选出所有年龄大于 13 岁的学生。”用伪代码:SELECT * FROM Students WHERE Age > 13。或者解释数据库使用字段、记录和主键。
Sorting algorithms are limited to bubble sort and sometimes simple insertion explanation. A typical task: "Show the steps of a bubble sort on these numbers: 5, 2, 8, 1." You must demonstrate comparing adjacent pairs and swapping if they are in the wrong order. The list after the first pass: 2, 5, 1, 8. After second: 2, 1, 5, 8. After third: 1, 2, 5, 8. You need to note that after each pass, the largest unsorted element "bubbles" to the end.
排序算法限于冒泡排序,有时涉及简单的插入排序解释。典型任务:“展示对这些数字进行冒泡排序的步骤:5, 2, 8, 1。”你必须演示比较相邻两数,若顺序错误则交换。第一趟后:2, 5, 1, 8。第二趟后:2, 1, 5, 8。第三趟后:1, 2, 5, 8。需要指出每趟后最大的未排序元素“冒泡”到末尾。
s, bubble sort makes n-1 comparisons in the first pass, n-2 in the second, etc., for a worst-case total of (n-1)+(n-2)+… ed to identify that a list is already sorted after a pass with no swaps, allowing early termination.
真题经常要求说出所需比较次数。对 n 项,冒泡排序第一趟进行 n-1 次比较,第二趟 n-2 次,总计最坏情况 (n-1)+(n-2)+…+1 = n(n-1)/2。4 项的最坏情况为 6 次比较。也可能要求识别出若某趟没有发生交换,则列表已排序,可提前终止。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图