📚 Year 8 SQA Computer Science: Unit Test Mock Paper Walkthrough | Year 8 SQA 计算机:单元测试模拟卷解析
This article walks through a complete mock unit test for Year 8 SQA Computer Science. Each section presents a typical exam-style question, followed by a detailed answer and explanation. Use this resource to check your understanding of algorithms, programming, data representation, hardware, safety, and computational thinking.
本文带领你完成一份 Year 8 SQA 计算机科学单元测试模拟卷。每个部分给出一道典型的考试题型,然后提供详细的答案和解析。利用这份资源来检测你对算法、编程、数据表示、硬件、网络安全和计算思维的理解。
1. Algorithms and Everyday Examples | 算法与日常实例
Question: What is an algorithm? Give one real-world example of an algorithm that you follow in your daily life.
问题: 什么是算法?给出一个你在日常生活中遵循的真实算法例子。
An algorithm is a precise, step-by-step set of instructions designed to accomplish a task or solve a problem. A common daily example is making a cup of tea: fill the kettle, boil the water, put a tea bag in a cup, pour the hot water, wait for a few minutes, remove the bag, and add milk if desired. Each step must be followed in order to achieve the expected result.
算法是一套精确、逐步的指令集合,旨在完成一项任务或解决一个问题。一个常见的日常例子是泡一杯茶:给水壶加满水,烧开水,把茶包放进杯子里,倒入热水,等待几分钟,取出茶包,需要的话加入牛奶。每一步必须按顺序进行才能得到预期的结果。
In computing, algorithms must be unambiguous, have a finite number of steps, and terminate. They can be expressed in plain English, as flowcharts, or in programming code.
在计算领域,算法必须清楚明确、步骤有限并且有终止条件。它们可以用通俗语言、流程图或编程代码来表达。
2. Flowcharts and Decision Making | 流程图与决策
Question: Draw a flowchart that inputs a number and outputs whether the number is positive, negative, or zero. Explain the meaning of each symbol used.
问题: 绘制一个流程图,输入一个数字,输出该数字是正数、负数还是零。解释所用的每种符号的含义。
A typical solution uses an oval for Start/End, a parallelogram for Input (enter the number), a diamond for Decision (check if the number > 0, then check if the number < 0), and parallelograms for Output messages. Arrows show the flow of control. If the number is greater than zero, output "Positive"; otherwise check if it is less than zero, output "Negative"; otherwise output "Zero".
一个典型的解答使用椭圆形表示开始/结束,平行四边形表示输入(输入数字),菱形表示判断(检查数字是否大于 0,然后检查是否小于 0),平行四边形表示输出信息。箭头表示控制流程。如果数字大于零,输出"正数";否则检查是否小于零,输出"负数";否则输出"零"。
Flowchart symbols are standardised: a rounded rectangle or oval marks the start and end points; a rectangle represents a process or operation; a diamond shows a decision point with yes/no branches; a parallelogram indicates input or output. Using these symbols correctly makes algorithms easy to understand and debug.
流程图符号是标准化的:圆角矩形或椭圆形标记起点和终点;矩形表示一个过程或操作;菱形显示一个带有"是/否"分支的决策点;平行四边形表示输入或输出。正确使用这些符号使得算法易于理解和调试。
3. Binary Number Conversion | 二进制数转换
Question: Convert the decimal number 45 into an 8-bit binary number. Show your working.
问题: 将十进制数 45 转换为 8 位二进制数。写出你的计算过程。
Using the method of successive division by 2: 45 ÷ 2 = 22 remainder 1 22 ÷ 2 = 11 remainder 0 11 ÷ 2 = 5 remainder 1 5 ÷ 2 = 2 remainder 1 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1 from bottom to top gives 101101. As an 8-bit number, we pad with leading zeros: 00101101₂.
使用不断除以 2 的方法: 45 ÷ 2 = 22 余 1 22 ÷ 2 = 11 余 0 11 ÷ 2 = 5 余 1 5 ÷ 2 = 2 余 1 2 ÷ 2 = 1 余 0 1 ÷ 2 = 0 余 1 从下往上读取余数得到 101101。作为 8 位二进制数,我们在前面补零:00101101₂。
45₁₀ = 00101101₂
erstanding binary is essential because computers store all data as sequences of 0s and 1s.
最右边的列表示位值 2⁰ (1),接下来是 2¹ (2),然后是 4、8、16、32、64、128。验证答案:32 + 8 + 4 + 1 = 45。理解二进制至关重要,因为计算机将所有数据存储为 0 和 1 的序列。
4. Computer Hardware Essentials | 计算机硬件基础
Question: Identify the main internal components of a computer system and briefly explain the role of each.
问题: 识别计算机系统的主要内部组件,并简要解释每个组件的作用。
The key components are the Central Processing Unit (CPU), which carries out instructions and performs calculations; Random Access Memory (RAM), which temporarily holds data and programs currently in use; the Hard Disk Drive (HDD) or Solid State Drive (SSD), which provides long-term storage; and the motherboard, which connects all parts and allows communication between them.
关键组件包括中央处理器 (CPU),它执行指令并进行计算;随机存取存储器 (RAM),临时保存当前正在使用的数据和程序;硬盘驱动器 (HDD) 或固态硬盘 (SSD),提供长期存储;以及主板,它将所有部件连接起来并允许它们之间进行通信。
In a typical exam, you might also be asked about the power supply unit (PSU) and cooling fans. The CPU is often described as the 'brain' of the computer, while RAM is like a workbench that clears when the power is off. Storage drives retain data even when the machine is switched off.
在典型的考试中,你可能还会被问及电源单元 (PSU) 和冷却风扇。CPU 通常被形容为计算机的"大脑",而 RAM 就像一个工作台,断电后内容会被清除。存储驱动器即使在机器关闭后也能保留数据。
5. Input, Output, and Storage Devices | 输入、输出与存储设备
Question: Classify the following devices as input, output, or storage: keyboard, monitor, USB flash drive, touch screen, printer, solid state drive, scanner, headphones.
问题: 将下列设备分类为输入设备、输出设备或存储设备:键盘、显示器、U 盘、触摸屏、打印机、固态硬盘、扫描仪、耳机。
| Device | Category |
|---|---|
| Keyboard | Input |
| Monitor | Output |
| USB Flash Drive | Storage |
| Touch Screen | Input & Output |
| Printer | Output |
| Solid State Drive | Storage |
| Scanner | Input |
| Headphones | Output |
Note that some devices, such as a touch screen, act as both input (sensing touch) and output (displaying images). Understanding device categories helps you describe how data flows into, out of, and is stored by a computer system.
请注意,某些设备(例如触摸屏)既可以是输入设备(感应触摸),也可以是输出设备(显示图像)。了解设备的类别有助于你描述数据如何输入、输出以及被计算机系统存储。
6. Scratch Programming Basics | Scratch 编程基础
Question: Write a Scratch script that makes a sprite move continuously to the right, and when it touches the edge of the stage, it bounces back. Use blocks.
问题: 编写一个 Scratch 脚本,使一个角色持续向右移动,当它碰到舞台边缘时,反弹回来。使用积木块。
The solution uses an event block 'when green flag clicked', a forever loop, a 'move 10 steps' block, and an 'if on edge, bounce' block. Inside the forever loop, the sprite moves 10 steps repeatedly; the bounce block reverses its direction when it hits the edge. You may also set the rotation style to left-right to prevent the sprite from turning upside down.
解答使用事件积木"当绿旗被点击"、一个无限循环、"移动 10 步"积木,以及"碰到边缘就反弹"积木。在无限循环内部,角色反复移动 10 步;反弹积木会在它碰到边缘时反转方向。你还可以把旋转模式设为左右翻转,以防止角色上下颠倒。
Scratch encourages logical thinking by snapping colour-coded blocks together. The 'forever' loop ensures the motion continues indefinitely, while the bounce block handles boundary detection. This simple script illustrates sequence, iteration, and event-driven programming.
Scratch 通过将颜色编码的积木拼接在一起来鼓励逻辑思维。"无限循环"确保运动无限继续,而反弹积木处理边界检测。这个简单的脚本演示了顺序、迭代和事件驱动的编程。
7. Variables and Repetition | 变量与重复结构
Question: Create a Scratch program that calculates the sum of all whole numbers from 1 to 10 using a variable and a loop. Describe what the code does at each stage.
问题: 创建一个 Scratch 程序,使用一个变量和一个循环计算从 1 到 10 的所有整数的和。描述代码在每个阶段的作用。
First, create a variable called 'total' and set it to 0. Then use a 'repeat 10' loop. Inside the loop, use a 'change total by' block, but you need another variable, 'count', which starts at 1 and increases by 1 each iteration. Inside the repeat loop, 'change total by count' and then 'change count by 1'. After the loop, display 'total'. Alternatively, use a 'for' loop in text-based Python: total = 0; for i in range(1,11): total = total + i.
首先,创建一个名为"total"的变量并将其设为 0。然后使用"重复执行 10 次"循环。在循环内部,利用"将 total 增加"积木,但是需要另一个变量"count",它从 1 开始,每次迭代增加 1。在重复循环内部,"将 total 增加 count",然后"将 count 增加 1"。循环结束后,显示"total"。或者,在文本式的 Python 中使用 for 循环:total = 0; for i in range(1,11): total = total + i。
The key concepts are initialisation (setting total to 0), iteration (repeating a task ten times), and accumulation (building up the result). Understanding variables and loops is fundamental because they let programs process large amounts of data efficiently.
关键概念是初始化(将 total 设为 0)、迭代(重复任务十次)和累积(建立最终结果)。理解变量和循环是基础,因为它们使得程序能够高效地处理大量数据。
8. Debugging Code Errors | 代码纠错
Question: A student wrote a Scratch script to make a cat walk back and forth across the screen, but the cat turns upside down when it bounces. Identify the error and show how to fix it.
问题: 一个学生编写了一个 Scratch 脚本,想让一只猫在屏幕上走来走去,但猫在反弹时上下颠倒。找出错误并说明如何修复。
The typical error is the sprite's rotation style is set to 'all around' by default, so when the direction flips 180 degrees, the costume appears upside down. To fix this, set the rotation style to 'left-right' using the 'set rotation style' block in the motion category. Place this block before the main loop, often right under the green flag block.
典型的错误是角色的旋转模式默认设为"任意旋转",因此当方向翻转 180 度时,造型会上下颠倒。要修复这个问题,使用运动类别中的"将旋转模式设为"积木,把旋转模式设为"左右翻转"。将这个积木放在主循环之前,通常紧接在绿旗积木下方。
Debugging involves reading code carefully, predicting what each block does, and testing fixes. Always check sprite rotation, initial positions, and loop conditions when your animation behaves unexpectedly.
调试包括仔细阅读代码,预测每个积木的作用,并测试修复方案。当你的动画表现异常时,务必检查角色的旋转模式、初始位置以及循环条件。
9. Internet Safety and Phishing | 网络安全与钓鱼邮件
Question: Describe two signs that an email might be a phishing attempt, and explain what action you should take when you suspect a phishing email.
问题: 描述一封电子邮件可能为钓鱼邮件的两个迹象,并解释当你怀疑一封钓鱼邮件时应该采取什么行动。
Phishing emails often create a sense of urgency, such as claiming your account will be closed unless you act immediately. They frequently ask you to click a link and provide personal information like passwords or bank details. Other signs include poor spelling/grammar, unfamiliar sender addresses, and generic greetings. If you suspect a phishing email, do not click any links or download attachments. Report it to your teacher or a trusted adult
Published by TutorHao | Year 8 Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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