Year 13 CCEA Computer Science: Unit Test Mock Paper Analysis | Year 13 CCEA 计算机:单元测试模拟卷解析

📚 Year 13 CCEA Computer Science: Unit Test Mock Paper Analysis | Year 13 CCEA 计算机:单元测试模拟卷解析

This article provides a thorough walkthrough of a mock unit test for Year 13 CCEA Computer Science. Key topics include data representation, Boolean logic, programming fundamentals, data structures, sorting algorithms, software development models, testing strategies, networking, and ethical issues. Each question is followed by a step‑by‑step solution with explanations to strengthen your understanding and exam readiness.

本文为 Year 13 CCEA 计算机科学单元测试模拟卷提供详尽解析。内容涵盖数据表示、布尔逻辑、编程基础、数据结构、排序算法、软件开发模型、测试策略、计算机网络以及伦理法律议题。每道题目均配有逐步解答与讲解,帮助你巩固知识、提升应考能力。

1. Data Representation: Binary to Hexadecimal Conversion | 数据表示:二进制与十六进制转换

Question: Convert the unsigned binary integer 10101110₂ to its hexadecimal equivalent. Show all steps.

问题: 将无符号二进制整数 10101110₂ 转换为十六进制数,写出所有步骤。

Solution

解答

Step 1: Group the binary digits into nibbles (4 bits) starting from the right. If necessary, pad the leftmost group with leading zeros. Here 10101110 becomes 1010 1110.

步骤 1:从右侧开始将二进制位分组,每 4 位一组(一个 nibble)。必要时在最左侧补零。10101110₂ 分组后为 1010 1110。

Step 2: Convert each 4‑bit group independently: 1010₂ = 10₁₀ = A₁₆, 1110₂ = 14₁₀ = E₁₆.

步骤 2:独立转换每组:1010₂ = 10₁₀ = A₁₆ , 1110₂ = 14₁₀ = E₁₆。

Step 3: Combine the hex digits in the same order. The result is AE₁₆.

步骤 3:按顺序合并十六进制数字,结果为 AE₁₆。

Extension: To convert hexadecimal 3F₁₆ back to binary, replace each hex digit with its 4‑bit binary form: 3₁₆ = 0011₂, F₁₆ = 1111₂ → 00111111₂ (or 111111₂ after removing leading zeros).

拓展: 将十六进制数 3F₁₆ 转回二进制时,把每个十六进制数字替换为对应的 4 位二进制:3₁₆ = 0011₂,F₁₆ = 1111₂,得到 00111111₂(去掉前导零后为 111111₂)。


2. Boolean Algebra: Simplifying Expressions Using Laws | 布尔代数:利用定律化简表达式

Question: Simplify the Boolean expression F = A ∧ B ∨ A ∧ ¬B. State the laws used at each step.

问题: 化简布尔表达式 F = A ∧ B ∨ A ∧ ¬B,并说明每一步使用的布尔定律。

Solution

解答

Step 1: Notice the common factor A. Using the distributive law in reverse: A ∧ B ∨ A ∧ ¬B = A ∧ (B ∨ ¬B).

步骤 1:注意到公因子 A,逆用分配律:A ∧ B ∨ A ∧ ¬B = A ∧ (B ∨ ¬B)。

Step 2: By the complement law, B ∨ ¬B = 1 (identity for OR).

步骤 2:根据互补律,B ∨ ¬B = 1(逻辑“或”的恒等元)。

Step 3: Finally, using the identity law A ∧ 1 = A. Hence F simplifies to A.

步骤 3:根据同一律 A ∧ 1 = A,最终 F 化简为 A。

Thus the original expression is equivalent to the single variable A.

因此原表达式等价于单个变量 A。


3. Logic Gates: NAND Gate Truth Table and Equivalent Expression | 逻辑门:NAND 门真值表及等价表达式

Question: A digital circuit consists of an AND gate whose output is fed into a NOT gate. The inputs are labelled A and B, and the final output is Q. (a) Write the Boolean expression for Q. (b) Complete the truth table for this circuit.

问题: 某数字电路由一个与门和其后连接的一个非门组成,输入标记为 A 和 B,最终输出为 Q。(a) 写出 Q 的布尔表达式。(b) 补全该电路的真值表。

Solution

解答

(a) The AND gate output is A ∧ B. The NOT gate inverts this, giving Q = ¬(A ∧ B). This is a NAND gate.

(a) 与门输出为 A ∧ B,非门将其取反,故 Q = ¬(A ∧ B),即与非门。

(b) Truth table with four possible input combinations:

(b) 含有四种输入组合的真值表:

A B A ∧ B Q = ¬(A ∧ B)
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0

The output is LOW only when both inputs are HIGH, characteristic of NAND logic.

只有当两个输入均为高电平时输出才为低电平,这正是 NAND 逻辑的特征。


4. Programming Fundamentals: Tracing a Loop | 编程基础:循环跟踪

Question: Study the following pseudocode and determine the final value of the variable total.

问题: 分析以下伪代码,确定变量 total 的最终值。

total ← 0
FOR i ← 1 TO 5
    total ← total + i*i
ENDFOR
OUTPUT total

Solution

解答

We trace the loop iteration by iteration, updating total each time.

我们逐次跟踪循环,每次更新 total。

i = 1: total = 0 + 1² = 0 + 1 = 1

i = 1 时:total = 0 + 1² = 0 + 1 = 1

i = 2: total = 1 + 2² = 1 + 4 = 5

i = 2 时:total = 1 + 4 = 5

i = 3: total = 5 + 3² = 5 + 9 = 14

i = 3 时:total = 5 + 9 = 14

i = 4: total = 14 + 4² = 14 + 16 = 30

i = 4 时:total = 14 + 16 = 30

i = 5: total = 30 + 5² = 30 + 25 = 55

i = 5 时:total = 30 + 25 = 55

The loop terminates. The output is 55.

循环结束,最终输出为 55。


5. Data Structures: Stack Operations | 数据结构:栈操作

Question: An empty stack undergoes the following sequence of operations: push(‘A’), push(‘B’), pop(), push(‘C’), push(‘D’), pop(), pop(). Show the stack contents after each operation and state the final top element.

问题: 空栈依次执行以下操作:push(‘A’), push(‘B’), pop(), push(‘C’), push(‘D’), pop(), pop()。请展示每一步后栈的内容,并指出最终的栈顶元素。

Solution

解答

We represent the stack with the top on the right.

我们将栈顶表示在右侧。

Start: [ ]

开始:[ ]

push(‘A’) → [A]

push(‘A’) → [A]

push(‘B’) → [A, B]

push(‘B’) → [A, B]

pop() removes ‘B’ → [A] (returns B)

pop() 移除 ‘B’ → [A](返回 B)

push(‘C’) → [A, C]

push(‘C’) → [A, C]

push(‘D’) → [A, C, D]

push(‘D’) → [A, C, D]

pop() removes ‘D’ → [A, C]

pop() 移除 ‘D’ → [A, C]

pop() removes ‘C’ → [A]

pop() 移除 ‘C’ → [A]

The final top element is ‘A’. (If the pop returns the element, the last pop returns ‘A’ and the stack becomes empty, but the question asks for the top after the sequence; the last operation is pop() which removes the item, so after the sequence the stack contains only ‘A’? Actually the sequence ends with pop() that removes ‘C’, leaving [A]. So top is ‘A’. Correct.)

最终的栈顶元素为 ‘A’。(最后一个 pop() 移除了 ‘C’,栈中留下 [A],因此栈顶为 ‘A’。)


6. Sorting Algorithms: Bubble Sort First Pass | 排序算法:冒泡排序第一趟

Question: The list [5, 3, 8, 4, 2] is to be sorted into ascending order using bubble sort. Show the state of the list after the first complete pass.

问题: 使用冒泡排序将列表 [5, 3, 8, 4, 2] 按升序排列,展示第一趟完整遍历后列表的状态。

Solution

解答

In bubble sort, we repeatedly compare adjacent items and swap them if they are in the wrong order. A pass goes from start to end, placing the largest element in its final position at the end.

冒泡排序反复比较相邻元素,若顺序错误则交换。一趟遍历从头至尾,将最大的元素移至它最终应在的末尾位置。

Initial list: [5, 3, 8, 4, 2]

初始列表:[5, 3, 8, 4, 2]

Compare 5 and 3 → swap because 5 > 3: [3, 5, 8, 4, 2]

比较 5 和 3 → 5 > 3,交换:[3, 5, 8, 4, 2]

Compare 5 and 8 → no swap (5 < 8): [3, 5, 8, 4, 2]

比较 5 和 8 → 不交换(5 < 8):[3, 5, 8, 4, 2]

Compare 8 and 4 → swap (8 > 4): [3, 5, 4, 8, 2]

比较 8 和 4 → 8 > 4,交换:[3, 5, 4, 8, 2]

Compare 8 and 2 → swap (8 > 2): [3, 5, 4, 2, 8]

比较 8 和 2 → 8 > 2,交换:[3, 5, 4, 2, 8]

End of first pass. The largest value (8) has bubbled to the last position.

第一趟结束,最大值 8 已“冒泡”至末端位置。


7. Software Development Lifecycle: Waterfall vs Agile | 软件开发生命周期:瀑布模型 vs 敏捷方法

Question: Compare the Waterfall and Agile approaches to software development, highlighting two strengths of each model.

问题: 比较瀑布模型与敏捷软件开发方法,分别指出每种模型的两项优势。

Solution

解答

Waterfall model strengths: (1) Simple, linear structure makes it easy to manage and understand. (2) Clear deliverables and milestones at the end of each phase facilitate documentation and planning.

瀑布模型的优势:(1) 简单线性的结构易于管理与理解。(2) 每个阶段结束时具有明确的交付产物和里程碑,便于文档化与规划。

Agile strengths: (1) Iterative development with frequent customer feedback ensures the product better meets user needs. (2) High adaptability to changing requirements even late in the project, reducing the risk of delivering an outdated system.

敏捷方法的优势:(1) 迭代开发结合频繁的客户反馈,确保产品更贴合用户需求。(2) 即使项目后期也能高度适应需求变更,降低交付过时系统的风险。

Waterfall suits projects with well‑understood, stable requirements; Agile excels when requirements are likely to evolve.

瀑布模型适用于需求明确稳定的项目;敏捷则在需求可能演变时表现优异。


8. Testing: Black‑Box and White‑Box Testing | 测试:黑盒测试与白盒测试

Question: Explain the difference between black‑box testing and white‑box testing, giving an example of a test case for each in the context of a login system.

问题: 解释黑盒测试与白盒测试的区别,并结合登录系统为每种测试各举一个测试用例示例。

Solution

解答

Black‑box testing focuses on inputs and outputs without knowledge of the internal code structure. Example: Test that entering a valid username and correct password grants access, whereas an invalid password shows an error—without examining the authentication algorithm.

黑盒测试侧重于输入与输出,不关心内部代码结构。示例:测试输入有效用户名和正确密码能成功登录,而错误密码显示错误提示,无需查看认证算法。

White‑box testing uses knowledge of the internal logic and paths. Example: Test that all branches of an if‑else statement inside the login function are covered—e.g., a condition for locked accounts after three failed attempts—to ensure the lockout mechanism works.

白盒测试利用对内部逻辑和执行路径的了解。示例:测试登录函数中 if‑else 语句的所有分支均被覆盖,如连续三次失败后账户锁定的分支,确保锁定机制有效。

Both techniques are complementary in V&V.

两种技术在验证与确认中互为补充。


9. Computer Networks: Calculating Network Address and Host ID | 计算机网络:计算网络地址与主机号

Question: Given an IPv4 address 192.168.1.10 with subnet mask 255.255.255.0, determine the network address and the host portion. Explain how the subnet mask is used.

问题: 已知 IPv4 地址 192.168.1.10 及子网掩码 255.255.255.0,求出网络地址和主机部分,并说明子网掩码的应用方式。

Published by TutorHao | Year 13 Computer Science Revision Series | aleveler.com

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

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version