📚 Year 12 WJEC Computer Science: Unit Test Mock Exam Analysis | WJEC Year 12 计算机单元测试模拟卷解析
Mock exams are essential tools for mastering the Year 12 WJEC Computer Science syllabus. This article provides a detailed analysis of a representative unit test, covering key question types, common pitfalls, and effective revision strategies. By working through these sample questions and explanations, you will strengthen your understanding of data representation, algorithms, programming, system architecture, and networking – all critical components of the WJEC specification.
模拟考试是掌握 Year 12 WJEC 计算机科学课程的重要工具。本文针对一份典型的单元测试卷进行详细解析,涵盖关键题型、常见错误和高效复习策略。通过研读这些样题和解析,你将加深对数据表示、算法、编程、系统架构和网络等核心内容的理解,这些均为 WJEC 考纲的关键组成部分。
1. Paper Overview & Assessment Format | 试卷概览与评估格式
The WJEC Year 12 unit test typically consists of three sections: Section A – multiple-choice questions testing fundamental knowledge; Section B – short-answer and structured questions requiring application and analysis; and Section C – extended programming or scenario-based tasks. This mock paper mirrors that structure, allocating 60 minutes for completion under exam conditions. Understanding the mark distribution helps you allocate time wisely – roughly 1 minute per mark.
WJEC Year 12 单元测试通常包含三个部分:Section A – 考查基础知识的单选题;Section B – 要求应用和分析的简答题及结构化问题;Section C – 扩展编程或情境任务。本模拟卷复现了这一结构,建议考试条件下 60 分钟完成。理解分值分布有助于合理分配时间——大约一分钟一分。
2. Multiple Choice: Data Representation & Number Systems | 选择题:数据表示与数制
Question 1: What is the denary value of the two’s complement binary number 1101 0110? (A) -42 (B) -86 (C) 86 (D) 214. Answer: A. The most significant bit is 1, indicating a negative number. Flip the bits: 0010 1001, add 1 gives 0010 1010 = 42, so the original number is -42. Many students mistakenly treat it as unsigned.
题目 1:二进制补码 1101 0110 的十进制值是多少?(A) -42 (B) -86 (C) 86 (D) 214。答案:A。最高位为 1,表示负数。按位取反得到 0010 1001,加 1 得 0010 1010 = 42,因此原数为 -42。很多学生误将其当作无符号数处理。
Question 2: Which hexadecimal value corresponds to the binary sequence 1010 1111 0001 0100? (A) AF14 (B) 9F14 (C) AE14 (D) B014. Answer: A. Group bits into nibbles: 1010 = A, 1111 = F, 0001 = 1, 0100 = 4, thus AF14. Ensure you can convert fluently between hex and binary for file sizes and memory addresses.
题目 2:二进制序列 1010 1111 0001 0100 对应的十六进制值是?(A) AF14 (B) 9F14 (C) AE14 (D) B014。答案:A。将位分组为半字节:1010 = A, 1111 = F, 0001 = 1, 0100 = 4,因此得到 AF14。确保你能在十六进制和二进制之间流畅转换,这在文件大小和内存地址题目中很常见。
3. Multiple Choice: Boolean Logic & Circuit Simplification | 选择题:布尔逻辑与电路化简
Question 3: The Boolean expression (A + B) · (A + C) simplifies to: (A) A + (B · C) (B) A · (B + C) (C) A + B + C (D) A · B · C. Answer: A. Applying the distributive law: (A+B)(A+C) = A + BC. This is a classic simplification often examined; drawing a truth table can also verify the equivalence.
题目 3:布尔表达式 (A + B) · (A + C) 化简后的结果是:(A) A + (B · C) (B) A · (B + C) (C) A + B + C (D) A · B · C。答案:A。应用分配律:(A+B)(A+C) = A + BC。这是一个常考点的经典化简;绘制真值表也可验证等价性。
Question 4: A logic circuit has three inputs X, Y, Z and outputs 1 only when an odd number of inputs are 1. This is described by: (A) XOR of all three inputs (B) X AND Y AND Z (C) (X OR Y) AND Z (D) NOT (X XOR Y XOR Z). Answer: A. Odd parity is exactly the three-input XOR function: X ⊕ Y ⊕ Z, true for (0,0,1), (0,1,0), (1,0,0), (1,1,1).
题目 4:一个逻辑电路有三个输入 X, Y, Z,仅当输入中 1 的个数为奇数时输出 1。以下哪个表达式描述该功能?(A) 三个输入的异或 (B) X AND Y AND Z (C) (X OR Y) AND Z (D) NOT (X XOR Y XOR Z)。答案:A。奇校验恰好对应三输入异或函数:X ⊕ Y ⊕ Z,当输入为 (0,0,1), (0,1,0), (1,0,0), (1,1,1) 时成立。
4. Short Answer: Algorithms & Flowchart Design | 简答题:算法与流程图设计
Question 5: Design a flowchart to find the maximum value in an array of 10 positive integers. Your flowchart should include initialization, a loop structure, and output the result. The solution begins with a start oval, then initialise max = 0 and counter = 0. Inside a loop, input the number, compare with max; if greater, update max. Increment counter and repeat until counter = 10. Finally, output max. Many candidates forget to initialise max and lose marks for logical incompleteness.
题目 5:设计一个流程图,找出包含 10 个正整数的数组中的最大值。流程图应包含初始化、循环结构并输出结果。解题思路:从开始椭圆出发,初始化 max = 0 和 counter = 0。在循环内输入数字,与 max 比较;如果更大则更新 max。计数器递增,直到 counter = 10。最后输出 max。许多考生忘记初始化 max,因逻辑不完整而失分。
5. Short Answer: Storage & Data Structures | 简答题:存储与数据结构
Question 6: Explain the difference between static and dynamic data structures, giving one advantage of each. Static structures (e.g. array) have fixed size allocated at compile time, offering fast access but limited flexibility. Dynamic structures (e.g. linked list) can grow or shrink at runtime, making better use of memory but may have overhead of pointers. A typical response should reference memory allocation and performance trade-offs.
题目 6:解释静态和动态数据结构的区别,各给出一个优点。静态结构(如数组)在编译时分配固定大小,访问速度快但灵活性有限。动态结构(如链表)可在运行时增长或收缩,更好地利用内存,但可能带来指针开销。典型答案应涉及内存分配和性能权衡。
Question 7: A queue is implemented using an array with front and rear pointers. Describe how to detect when the queue is full in a circular implementation. If front = (rear + 1) mod size, the queue is considered full. This sacrifices one slot to distinguish full from empty. Mention that without this convention full and empty conditions (front == rear) are identical, causing ambiguity.
题目 7:使用数组和 front、rear 指针实现队列。描述在循环实现中如何检测队列已满。若 front = (rear + 1) mod size,则认为队列已满。此方法牺牲一个元素位来区分满和空。需指出若无此约定,满条件 (front == rear) 与空条件相同,产生歧义。
6. Programming Task: File Handling & String Manipulation | 编程题:文件处理与字符串操作
Question 8: Write a Python program that reads a text file named ‘words.txt’ and outputs the number of words that start with a vowel (a, e, i, o, u, case-insensitive). Sample solution opens the file, iterates through each line, splits into words, checks if word[0].lower() in ‘aeiou’, increments a counter, and prints the total. Common errors include not stripping punctuation and miscounting empty strings.
题目 8:编写一个 Python 程序,读取名为 ‘words.txt’ 的文本文件,输出以元音字母 (a, e, i, o, u,大小写不敏感) 开头的单词数量。示例解法:打开文件,逐行迭代,拆分为单词,检查 word[0].lower() in ‘aeiou’,递增计数器,并打印总数。常见错误包括未去除标点符号,以及将空字符串计入。
Good practice also includes using with open(...) as f: for automatic file closing, and handling FileNotFoundError with try-except. WJEC mark schemes reward robust code that considers edge cases. Test with words like ‘Apple’, ‘egg’, and lines containing tabs or multiple spaces.
良好实践还包括使用 with open(...) as f: 自动关闭文件,并用 try-except 处理 FileNotFoundError。WJEC 评分方案青睐考虑边界情况的健壮代码。可使用 ‘Apple’、’egg’ 以及包含制表符或多个空格的行进行测试。
7. Programming Task: Sorting Algorithm Implementation | 编程题:排序算法实现
Question 9: Implement the bubble sort algorithm to sort a list of integers in ascending order. Provide a step-by-step trace for the list [4, 2, 7, 1]. The algorithm compares adjacent elements and swaps them if out of order; repeats passes until no swaps occur. A traced solution shows first pass: (4,2) swap -> [2,4,7,1], (4,7) no swap, (7,1) swap -> [2,4,1,7]; second pass: (2,4) no swap, (4,1) swap -> [2,1,4,7], (4,7) no swap; third pass: (2,1) swap -> [1,2,4,7], sorted. Marks are awarded for correct swapping logic and pass termination.
题目 9:实现冒泡排序算法,将一个整数列表按升序排列。并为列表 [4, 2, 7, 1] 提供逐步跟踪。算法比较相邻元素,若顺序错误则交换;重复遍历,直到没有交换发生。跟踪解答:第一趟:(4,2) 交换 -> [2,4,7,1],(4,7) 不交换,(7,1) 交换 -> [2,4,1,7];第二趟:(2,4) 不交换,(4,1) 交换 -> [2,1,4,7],(4,7) 不交换;第三趟:(2,1) 交换 -> [1,2,4,7],完成排序。正确的交换逻辑和遍历终止条件均可得分。
8. System Architecture: Fetch-Decode-Execute Cycle | 系统架构:取指-解码-执行周期
Question 10: With the aid of a diagram, describe the role of the Program Counter (PC) and Memory Address Register (MAR) during the fetch stage. The PC holds the address of the next instruction; this address is copied to the MAR, which then sends it via the address bus to main memory. The instruction is fetched into the Memory Buffer Register (MBR). The PC is then incremented. Many students confuse MAR and MBR functions, so clear labelling is crucial.
题目 10:借助图示,描述程序计数器 (PC) 和内存地址寄存器 (MAR) 在取指阶段的作用。PC 存放下一条指令的地址;该地址复制到 MAR,然后通过地址总线发送至主存。指令被取出并存入内存缓冲寄存器 (MBR)。随后 PC 自增。许多学生混淆 MAR 和 MBR 的功能,因此清晰的标注至关重要。
Question 11: Compare CISC and RISC architectures in terms of instruction complexity, execution time, and typical use. CISC has complex instructions, variable length, and often requires multiple clock cycles; used in desktops. RISC has simple, fixed-length instructions, one cycle per instruction, and is common in mobile/embedded devices. WJEC expects you to link these to compiler design and power efficiency.
题目 11:比较 CISC 与 RISC 架构,从指令复杂度、执行时间和典型用途方面分析。CISC 指令复杂、变长,常需多个时钟周期;多用于台式机。RISC 指令简单、定长,每条指令一个周期;常见于移动/嵌入式设备。WJEC 希望你将其与编译器设计和能效联系起来。
9. Networking: Protocols & Layering | 网络:协议与分层
Question 12: Explain the purpose of the TCP/IP stack’s Application and Transport layers, giving one protocol example for each. Application layer provides network services to user applications (e.g. HTTP, FTP, SMTP). Transport layer ensures reliable or unreliable end-to-end delivery; TCP provides connection-oriented, error-checked transmission, while UDP offers fast, connectionless communication. Understanding the encapsulation process is often tested alongside.
题目 12:解释 TCP/IP 协议栈中应用层和传输层的作用,并各举一个协议例子。应用层为用户程序提供网络服务(如 HTTP、FTP、SMTP)。传输层确保端到端的可靠或不可靠交付;TCP 提供面向连接的、带错误校验的传输,而 UDP 提供快速、无连接通信。封装过程常与此一并考查。
Question 13: A web client sends an HTTP request to a server. Describe how the Domain Name System (DNS) is involved before the request is sent. The client’s resolver queries DNS servers to translate the domain (e.g. http://www.example.com) into an IP address. This involves iterative or recursive queries across root, TLD, and authoritative servers. Caching at various levels reduces response time. A complete answer references the resolver, iterative vs. recursive approach, and record types (A, AAAA).
题目 13:一个 Web 客户端向服务器发送 HTTP 请求。描述在发送请求前域名系统 (DNS) 如何参与。客户端的解析器向 DNS 服务器查询,将域名(如 http://www.example.com)转换为 IP 地址。这涉及在根服务器、顶级域名服务器和权威服务器之间进行迭代或递归查询。各级缓存可缩短响应时间。完整答案需提及解析器、迭代与递归方式以及记录类型(A, AAAA)。
10. Error Identification & Debugging Techniques | 错误排查与调试技巧
Question 14: The following Python function aims to return the factorial of n but contains a logical error. Identify and fix it. def factorial(n): result = 1; for i in range(n): result = result * i; return result. The bug: range(n) starts at 0, so the multiplication by 0 clears the result. Fix: use for i in range(1, n+1):. Also, no handling for n=0 (by definition 0! = 1) but the corrected loop gives 1 if no iteration occurs. A robust version should check n < 0 and raise an error.
题目 14:以下 Python 函数旨在返回 n 的阶乘,但存在逻辑错误。找出并修正。def factorial(n): result = 1; for i in range(n): result = result * i; return result。错误:range(n) 从 0 开始,乘以 0 导致结果归零。修正:使用 for i in range(1, n+1):。此外,未处理 n=0(定义 0! = 1),但修正后若没有迭代则返回 1。健壮版本应检查 n < 0 并抛出异常。
Question 15: A student’s code for a binary search never finds the target and enters an infinite loop. Suggest two possible causes. (1) The midpoint calculation as (low + high) // 2 can cause overflow in some languages, but more likely in Python, the comparators are reversed or low/high not updated correctly. (2) Missing base case termination, e.g. while low <= high incorrectly written as while low < high leading to failure to narrow down to a single element. Debugging with print statements or a trace table is recommended.
题目 15:某学生的二分搜索代码始终找不到目标值并陷入无限循环。提出两种可能原因。(1) 中间值计算 (low + high) // 2 在某些语言中可能溢出,但在 Python 中更可能是比较符号写反或 low/high 未正确更新。(2) 缺失基本终止条件,例如 while low <= high 误写为 while low < high,导致无法收缩到单个元素。建议使用 print 语句或跟踪表进行调试。
11. Conclusion & Revision Tips for WJEC Unit Test | 总结与 WJEC 单元测试复习建议
Success in the Year 12 WJEC unit test requires a balanced approach: memorize key facts (e.g., binary conversions, Boolean laws, protocol ports) and practice applying them through past papers and programming exercises. Time management during the mock is vital – tackle high-mark questions first. After attempting this mock, review your errors, rewrite code from scratch, and create flashcards for definitions. Consistent revision of the fetch-execute cycle, data structures, and algorithm tracing will build the confidence needed for the real exam.
在 Year 12 WJEC 单元测试中取得成功需要均衡的方法:牢记关键事实(如二进制转换、布尔定律、协议端口),并通过历年真题和编程练习加以应用。模拟考试中时间管理至关重要——先回答高分题目。完成此模拟卷后,回顾错误、从头重写代码,并制作定义抽认卡。持续复习取指-执行周期、数据结构和算法跟踪,将帮助你建立真实考试所需的信心。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导