Year 11 CCEA Computer Science: Unit Test Mock Paper Walkthrough | Year 11 CCEA 计算机科学单元测试模拟卷解析

📚 Year 11 CCEA Computer Science: Unit Test Mock Paper Walkthrough | Year 11 CCEA 计算机科学单元测试模拟卷解析

This article provides a detailed walkthrough of a typical Year 11 CCEA Computer Science unit test mock paper. Each question is broken down with step-by-step explanations and key revision points, helping students consolidate their understanding of core topics from both theory and programming units.

本文详细解析了一份典型的 Year 11 CCEA 计算机科学单元测试模拟卷。每道题目都配有逐步讲解和重要复习要点,帮助学生巩固理论单元与编程单元的核心知识。


1. Question 1: Number Bases – Binary and Hexadecimal Conversions | 问题1:数制转换 – 二进制与十六进制转换

The question asks you to convert the denary number 215 into binary and hexadecimal, and also to convert the hexadecimal number 2F into denary.

题目要求将十进制数 215 转换为二进制和十六进制,同时将十六进制数 2F 转换为十进制。

To convert 215 into binary, repeatedly divide by 2 and record the remainders: 215 ÷ 2 = 107 remainder 1, 107 ÷ 2 = 53 remainder 1, 53 ÷ 2 = 26 remainder 1, 26 ÷ 2 = 13 remainder 0, 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1. Read the remainders backwards: 11010111.

将 215 转换为二进制,连续除以 2 并记录余数:215 ÷ 2 = 107 余 1,107 ÷ 2 = 53 余 1,53 ÷ 2 = 26 余 1,26 ÷ 2 = 13 余 0,13 ÷ 2 = 6 余 1,6 ÷ 2 = 3 余 0,3 ÷ 2 = 1 余 1,1 ÷ 2 = 0 余 1。反向读取余数得到 11010111。

To obtain the hexadecimal equivalent, split the binary number into groups of four bits (nibbles) from the right: 1101 0111. 1101 represents denary 13, which is D in hex; 0111 represents 7. Thus, 215 in hexadecimal is D7.

要得到十六进制,将二进制数从右向左每四位分为一组(半字节):1101 0111。1101 表示十进制 13,即十六进制的 D;0111 表示 7。因此 215 的十六进制为 D7。

For the reverse conversion, the hexadecimal number 2F represents (2 × 16¹) + (F × 16⁰), where F equals 15 in denary. So the calculation is 2 × 16 + 15 = 32 + 15 = 47.

反向转换时,十六进制数 2F 表示 (2 × 16¹) + (F × 16⁰),其中 F 等于十进制 15。因此计算得 2 × 16 + 15 = 32 + 15 = 47。


2. Question 2: Logic Gates and Truth Tables | 问题2:逻辑门与真值表

A logic circuit is given with inputs A, B, C, and output Q. The circuit performs the operation Q = (A AND B) OR (NOT C). You are asked to draw the truth table and identify the type of gate that could replace the whole circuit.

给定一个逻辑电路,输入为 A、B、C,输出为 Q。电路执行的逻辑运算是 Q = (A AND B) OR (NOT C)。要求画出真值表,并指出可以用哪种门电路替代整个电路。

Create a truth table with all 8 possible combinations of inputs. Calculate the intermediate values: D = A AND B, E = NOT C, and finally Q = D OR E.

创建一个包含所有 8 种输入组合的真值表。计算中间值:D = A AND B,E = NOT C,最后 Q = D OR E。

A B C A AND B NOT C Q
0 0 0 0 1 1
0 0 1 0 0 0
0 1 0 0 1 1
0 1 1 0 0 0
1 0 0 0 1 1
1 0 1 0 0 0
1 1 0 1 1 1
1 1 1 1 0 1

Observing the Q column, the output is 0 only when C=1 and both A and B are 0, or when C=1 and one of A or B is 0 but the other is also 0? Wait, analyzing carefully: Q is 1 in all rows except when C=1 and A AND B = 0. That condition suggests the circuit behaves as a NAND gate if C is ignored? Actually, the output can be described as Q = NOT C OR (A AND B). This cannot be replaced by a single standard two-input gate; however, a three-input gate like the majority gate? A common exam twist: they might ask for an equivalent combination. If the question expects a simpler expression, note that (A AND B) OR (NOT C) does not reduce to a single basic gate. However, a possible answer is that it is functionally equivalent to a NAND gate if we consider C as an active-low input? Better to state that no single two-input gate can replace it, but if C were tied to a fixed value, it could become an OR or buffer. In a CCEA context, they may accept a truth table and note that the circuit is a combination of AND, OR, NOT.

观察 Q 列,只有 C=1 且 A 与 B 同时为 0 时输出为 0。该电路的逻辑可表示为 Q = (A AND B) OR (NOT C)。无法用单个标准二输入门替代;这是与门、非门和或门的组合。如果在考试中遇到,可以直接说明它是由基本门构成的复合电路,其行为如实值表所示。


3. Question 3: CPU Architecture and Performance | 问题3:CPU 体系结构与性能

Outline the fetch-decode-execute cycle and explain how clock speed, cache size, and number of cores affect CPU performance.

简述取指-解码-执行周期,并说明时钟速度、缓存大小和内核数量如何影响 CPU 性能。

The fetch-decode-execute cycle is the process by which the CPU executes program instructions. During the fetch stage, the Program Counter (PC) holds the address of the next instruction. This address is sent to memory via the address bus, and the instruction is retrieved and placed into the Current Instruction Register (CIR). The PC is then incremented to point to the next instruction.

取指-解码-执行周期是 CPU 执行程序指令的过程。在取指阶段,程序计数器(PC)保存下一条指令的地址。该地址通过地址总线发送到内存,指令被取出并放入当前指令寄存器(CIR)。然后 PC 增加以指向下一条指令。

In the decode stage, the Control Unit (CU) interprets the instruction in the CIR and prepares the necessary control signals. In the execute stage, the arithmetic logic unit (ALU) performs the required operation, which may involve reading data from registers or memory and writing results back.

在解码阶段,控制单元(CU)解释 CIR 中的指令并准备必要的控制信号。在执行阶段,算术逻辑单元(ALU)执行所需操作,可能涉及从寄存器或内存读取数据并将结果写回。

Clock speed, measured in gigahertz, determines the number of cycles per second. A higher clock speed means more instructions can be processed per second, improving performance. Cache memory is high-speed memory located close to the CPU; a larger cache reduces the time the CPU spends waiting for data from RAM. Multiple cores allow the CPU to execute multiple instructions simultaneously, essentially handling several tasks in parallel, which greatly boosts multitasking and processing power.

时钟速度以千兆赫兹为单位,决定每秒的周期数。更高的时钟速度意味着每秒可处理更多指令,从而提升性能。缓存是位于 CPU 附近的高速存储器;更大的缓存减少了 CPU 等待 RAM 数据的时间。多核允许 CPU 同时执行多条指令,本质上并行处理多个任务,极大地提高了多任务处理能力和处理能力。


4. Question 4: Memory and Storage – RAM, ROM and Virtual Memory | 问题4:存储与存储器 – RAM、ROM 和虚拟内存

Compare the characteristics of RAM and ROM, and explain how virtual memory works when a computer runs out of RAM.

比较 RAM 和 ROM 的特性,并解释计算机 RAM 不足时虚拟内存如何工作。

RAM (Random Access Memory) is volatile, meaning it loses its contents when power is turned off. It is used to store the operating system, applications, and data currently in use, allowing fast read and write access by the CPU. ROM (Read-Only Memory) is non-volatile; it retains data without power and typically stores the BIOS or firmware needed to boot the computer. RAM is writable during normal operation, whereas ROM is programmed once and rarely changed.

RAM(随机存取存储器)是易失性的,断电后内容丢失。它用于存储当前使用的操作系统、应用程序和数据,允许 CPU 快速读写访问。ROM(只读存储器)是非易失性的,无需电源即可保留数据,通常存储启动计算机所需的 BIOS 或固件。正常运行时 RAM 可写,而 ROM 通常在出厂时编程且极少更改。

Virtual memory is a technique that uses a portion of the hard disk or SSD as an extension of RAM. When RAM is full, the operating system moves less frequently used data blocks, called pages, from RAM to a special area on the disk known as the swap file or page file. When those pages are needed again, they are swapped back into RAM, possibly displacing other pages. This process, called paging, allows a computer to run more applications than its physical RAM can hold, but because disk access is much slower than RAM, excessive reliance on virtual memory can cause significant slowdown.

虚拟内存是一种使用硬盘或 SSD 的一部分作为 RAM 的扩展的技术。当 RAM 已满时,操作系统将不常用的数据块(称为页)从 RAM 移出到磁盘上称为交换文件或页面文件的特殊区域。当再次需要这些页时,它们会被换回 RAM,可能置换出其他页。这个称为分页的过程使计算机能够运行比物理 RAM 容量更多的应用程序,但由于磁盘访问比 RAM 慢得多,过度依赖虚拟内存会导致严重减速。


5. Question 5: Algorithms – Tracing a Linear Search | 问题5:算法 – 线性搜索追踪

The mock paper provides an array: [7, 15, 3, 22, 9, 4, 12] and asks you to trace a linear search algorithm to find the value 9, counting the number of comparisons made.

模拟卷给出数组:[7, 15, 3, 22, 9, 4, 12],要求追踪线性搜索算法查找值 9 的过程,并统计比较次数。

The linear search algorithm starts at index 0 and compares each element sequentially with the target (9). At index 0, value is 7: not equal, so move to index 1. Value 15 does not match. Index 2 holds 3, no match. Index 3 holds 22, no match. Index 4 holds 9 – a match is found. Total comparisons performed: 5.

线性搜索算法从索引 0 开始,依次将每个元素与目标值(9)进行比较。索引 0 为 7,不等;索引 1 为 15,不匹配;索引 2 为 3,不匹配;索引 3 为 22,不匹配;索引 4 为 9,匹配成功。共执行了 5 次比较。

If the target had been 10, the algorithm would have checked all 7 elements and returned a ‘not found’ flag, requiring 7 comparisons. The time complexity is O(n) in the worst case.

如果目标是 10,算法将检查全部 7 个元素并返回“未找到”标志,需要进行 7 次比较。最坏情况下时间复杂度为 O(n)。


6. Question 6: Programming Constructs – Pseudocode Loop | 问题6:编程结构 – 伪代码循环

A pseudocode fragment is given: SUM ← 0; FOR i ← 1 TO 5; SUM ← SUM + i * i; ENDFOR; OUTPUT SUM. Explain what the code does and state the final output.

给出伪代码片段:SUM ← 0; FOR i ← 1 TO 5; SUM ← SUM + i * i; ENDFOR; OUTPUT SUM。解释代码的作用并陈述最终输出。

The code initialises the variable SUM to 0. It then enters a FOR loop with the counter i taking values from 1 to 5. In each iteration, the square of i is calculated and added to the existing total. This computes the sum of squares: 1² + 2² + 3² + 4² + 5² = 1 + 4 + 9 + 16 + 25 = 55. The final output is 55.

代码将变量 SUM 初始化为 0,然后进入 FOR 循环,计数器 i 取值为 1 到 5。每次迭代中,计算 i 的平方并加到当前总和上。它计算的是平方和:1² + 2² + 3² + 4² + 5² = 1 + 4 + 9 + 16 + 25 = 55。最终输出为 55。

Understanding the sequence and assignment statements is crucial. If the loop had been written as SUM ← 0; FOR i ← 1 TO 5; i ← i * i; SUM ← SUM + i; ENDFOR, the logic would be flawed because modifying the loop counter inside the loop is poor practice and would produce an entirely different (and likely unintended) result. Always be careful to use a separate variable for calculations.

理解顺序和赋值语句至关重要。如果循环写成 SUM ← 0; FOR i ← 1 TO 5; i ← i * i; SUM ← SUM + i; ENDFOR,则逻辑有误,因为在循环内部修改循环计数器是不良实践,会产生完全不同(且非预期)的结果。务必使用单独的变量进行计算。


7. Question 7: Data Representation – Bitmap Image Calculation | 问题7:数据表示 – 位图图像计算

A bitmap image has a resolution of 1024 × 768 pixels and uses a colour depth of 4 bits. Calculate the file size in bytes and explain how the use of a higher colour depth affects file size and image quality.

一幅位图图像分辨率为 1024 × 768 像素,色深为 4 位。计算以字节为单位的文件大小,并说明采用更高色深如何影响文件大小和图像质量。

First, calculate the total number of pixels: 1024 × 768 = 786,432 pixels. With a colour depth of 4 bits, each pixel requires 4 bits, so the total number of bits = 786,432 × 4 = 3,145,728 bits. Since 1 byte = 8 bits, the file size in bytes = 3,145,728 ÷ 8 = 393,216 bytes, which is approximately 384 KiB (since 393,216 ÷ 1024 = 384).

首先计算总像素数:1024 × 768 = 786,432 像素。色深为 4 位,每个像素需 4 位,总位数 = 786,432 × 4 = 3,145,728 位。因为 1 字节 = 8 位,文件大小(字节)= 3,145,728 ÷ 8 = 393,216 字节,约为 384 KiB(393,216 ÷ 1024 = 384)。

Higher colour depth means more bits per pixel, which allows a larger palette of colours. For example, 8-bit colour depth gives 2⁸ = 256 colours, while 24-bit provides millions of colours. However, image quality improves with smoother gradients, but the file size increases proportionally: doubling the bit depth doubles the raw image data size (ignoring compression).

更高的色深意味着每像素更多位数,从而允许更大的调色板。例如,8 位色深可提供 2⁸ = 256 种颜色,而 24 位可提供数百万种颜色。图像质量提高,渐变更平滑,但文件大小成比例增加:位深度加倍,原始图像数据大小也会加倍(忽略压缩)。


8. Question 8: Networks – Client-Server vs Peer-to-Peer | 问题8:网络 – 客户端-服务器与对等网络

Compare the client-server network model with a peer-to-peer (P2P) model, giving advantages and disadvantages of each. Additionally, name two protocols used on the internet and state their functions.

比较客户端-服务器网络模型与对等(P2P)网络模型,列出各自的优缺点。另外,说出互联网上使用的两种协议并说明其功能。

In a client-server model, one or more powerful central servers provide resources, files, or services, and clients request these services. Advantages include centralised management, easier backup, and better security control. Disadvantages are the high cost of server hardware and the risk of a single point of failure if the server goes down.

在客户端-服务器模型中,一个或多个功能强大的中央服务器提供资源、文件或服务,客户端请求这些服务。优点包括集中管理、便于备份和更好的安全控制。缺点是服务器硬件成本高,且如果服务器宕机则存在单点故障风险。

In a peer-to-peer network, all computers have equal status and can share resources directly without a central server. It is cheaper to set up and is robust because there is no reliance on a single machine. However, security is harder to enforce, backups are not centralised, and performance can degrade as more peers join.

在对等网络中,所有计算机地位平等,可以直接共享资源,无需中央服务器。设置成本较低,且不依赖单台机器因此具有健壮性。但安全措施难以实施,备份不集中,且随着更多节点加入性能可能下降。

Two common internet protocols are HTTP (Hypertext Transfer Protocol), which governs the transfer of web pages between a web server and a browser, and TCP/IP (Transmission Control Protocol/Internet Protocol), which handles the reliable transmission of data packets across the network, ensuring they arrive in the correct order.

两种常见的互联网协议是 HTTP(超文本传输协议),它管理网页在 web 服务器和浏览器之间的传输;以及 TCP/IP(传输控制协议/互联网协议),负责在网络中可靠传输数据包,确保数据包按正确顺序到达。


9. Question 9: Cybersecurity – SQL Injection Attack | 问题9:网络安全 – SQL 注入攻击

Explain what an SQL injection attack is and describe two methods a developer can use to prevent it in a web application.

解释什么是 SQL 注入攻击,并描述开发者在 Web 应用程序中可以用来防止它的两种方法。

An SQL injection attack occurs when a malicious user inserts specially crafted SQL statements into an input field (such as a login form) that are then executed by the back-end database. For example, entering ‘ OR ‘1’=’1 as a password could trick the system into returning all user records, bypassing authentication. This can lead to unauthorized data access, data deletion, or database corruption.

当恶意用户在输入字段(如登录表单)中插入特制的 SQL 语句,这些语句随后被后端数据库执行,就发生了 SQL 注入攻击。例如,输入 ‘ OR ‘1’=’1 作为密码可能欺骗系统返回所有用户记录,绕过身份验证。这可能导致未经授权的数据访问、数据删除或数据库损坏。

To prevent SQL injection, developers should use parameterised queries (also known as prepared statements), which separate SQL code from user input so that input is treated strictly as data, not executable code. Another effective method is input validation and sanitation, where input is checked for suspicious characters and escape sequences are neutralised. Using stored procedures can also add an extra layer of security by encapsulating the SQL logic on the database server.

为防止 SQL 注入,开发者应使用参数化查询(也称为预处理语句),将 SQL 代码与用户输入分开,使输入被严格视为数据而非可执行代码。另一种有效方法是输入验证和净化,检查输入中的可疑字符并中和转义序列。使用存储过程也可通过在数据库服务器上封装 SQL 逻辑来增加额外的安全层。


Published by TutorHao | Year 11 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