📚 Year 10 SQA Computing: Unit Test Mock Exam Analysis | Year 10 SQA 计算机:单元测试模拟卷解析
Mock exams play a vital role in preparing for the SQA Year 10 Computing Science assessment. This article walks you through a typical unit test, providing model answers and clear explanations for each question. We cover binary arithmetic, computer hardware, network fundamentals, programming constructs, databases, web technologies and software development principles. By reviewing these worked examples, you will sharpen your problem-solving skills and avoid common mistakes.
模拟考试是 SQA Year 10 计算机科学备考的重要环节。本文带你梳理一份典型的单元测试,为每道题目提供标准答案和清晰解析。内容涵盖二进制运算、计算机硬件、网络基础、编程结构、数据库、网页技术以及软件开发原则。通过研读这些解题范例,你将提升问题解决能力,避免常见错误。
1. Binary and Data Storage | 二进制与数据存储
50 r 0; 50 ÷ 2 = 25 r 0; 25 ÷ 2 = 12 r 1; 12 ÷ 2 = 6 r 0; 6 ÷ 2 = 3 r 0; 3 ÷ 2 = 1 r 1; 1 ÷ 2 = 0 r 1. Reading the remainders bottom to top gives 11001001₂. Insert a leading zero to fill 8 bits: 11001001₂ is already 8 bits.
题目 1:将十进制数 201 转换为 8 位二进制整数。写出转换过程。答案:连续除以 2。201 ÷ 2 = 100 余 1;100 ÷ 2 = 50 余 0;50 ÷ 2 = 25 余 0;25 ÷ 2 = 12 余 1;12 ÷ 2 = 6 余 0;6 ÷ 2 = 3 余 0;3 ÷ 2 = 1 余 1;1 ÷ 2 = 0 余 1。从下往上读余数得到 11001001₂。补齐 8 位已是 8 位。
: 1×2⁷ + 0×2⁶ + 1×2⁵ + 1×2⁴ + 0×2³ + 1×2² + 1×2¹ + 0×2⁰ = 128 + 0 + 32 + 16 + 0 + 4 + 2 + 0 = 182₁₀.
题目 2:计算二进制数 10110110₂ 的十进制值。写出计算过程。答案:每一位乘上对应的权值(2 的幂): 0×2⁶ + 1×2⁵ + 1×2⁴ + 0×2³ + 1×2² + 1×2¹ + 0×2⁰ = 128 + 0 + 32 + 16 + 0 + 4 + 2 + 0 = 182₁₀。
s per character, giving 2⁷ = 128 combinations, which restricts it to basic English letters, digits and symbols. Unicode can represent over 140,000 characters, supporting multiple languages and emojis, thus providing global coverage.
题目 3:解释为什么 ASCII 字符集只限于 128 个字符,并说明 Unicode 相对于 ASCII 的一个优点。答案:ASCII 每个字符使用 7 位,共 2⁷ = 128 种组合,仅限基本的英文字母、数字和符号。Unicode 可表示超过 140,000 个字符,支持多种语言和表情符号,实现全球覆盖。
2. Computer System Components | 计算机系统组件
Question 4: Describe the role of the processor's control unit (CU) and the arithmetic logic unit (ALU). Answer: The CU fetches, decodes and coordinates the execution of instructions; it sends control signals to other components. The ALU performs arithmetic operations (addition, subtraction) and logical operations (AND, OR, NOT).
题目 4:描述处理器中控制单元(CU)和算术逻辑单元(ALU)的作用。答案:控制单元负责取指、译码并协调指令的执行,向其他部件发送控制信号。算术逻辑单元执行算术运算(加、减)和逻辑运算(与、或、非)。
Question 5: A computer has 8 GB of RAM and a 512 GB solid-state drive (SSD). Outline two differences between RAM and SSD storage. Answer: RAM is volatile (loses data when power off) and directly accessed by the CPU, providing fast temporary storage. The SSD is non-volatile, offers much larger capacity and slower than RAM, used for long-term storage of files and applications.
题目 5:一台电脑配备 8 GB RAM 和 512 GB 固态硬盘(SSD)。列出 RAM 和 SSD 存储的两个区别。答案:RAM 是易失性的(断电数据丢失),由 CPU 直接访问,提供快速临时存储。SSD 非易失,容量大得多,速度较 RAM 慢,用于文件和应用的长期保存。
Question 6: Name the three main buses on a motherboard and briefly state what each carries. Answer: The address bus carries memory addresses from the processor to memory; the data bus transfers data between components; the control bus sends timing and control signals.
题目 6:主板上三条主要总线分别是什么?简述各自传输的内容。答案:地址总线将处理器发出的内存地址传送到存储器;数据总线在组件之间传输数据;控制总线发送定时和控制信号。
3. Network Types and Topologies | 网络类型与拓扑
Question 7: Distinguish between a LAN and a WAN. Give one example of each. Answer: A Local Area Network (LAN) covers a small geographical area, such as a school building or home, and typically uses Ethernet or Wi-Fi. A Wide Area Network (WAN) connects networks over large distances, such as the internet or a multinational company's private network using leased lines.
题目 7:区分局域网(LAN)和广域网(WAN),各举一例。答案:局域网覆盖小范围地理区域,如学校大楼或家庭,通常使用以太网或 Wi-Fi。广域网连接长距离的网络,如互联网或跨国公司的专线网络。
Question 8: Draw and compare a star topology and a bus topology. List one advantage and one disadvantage of each. Answer: In a star topology, all devices connect to a central switch; a single cable failure only affects one device, but the switch is a single point of failure. In a bus topology, all devices share a single backbone cable; it uses less cable and is simpler, but a break in the backbone disables the whole network.
题目 8:画出并比较星型拓扑和总线型拓扑。各列出一个优点和一个缺点。答案:星型拓扑中所有设备连接到一个中央交换机;单根线缆故障只影响一台设备,但交换机本身是单点故障。总线型拓扑中所有设备共享一条主干线缆;用线少、结构简单,但主干断裂会使全网瘫痪。
| Topology | Advantage | Disadvantage |
| Star / 星型 | Easy to isolate faults / 易隔离故障 | Central switch failure / 中央交换机故障 |
| Bus / 总线型 | Cheap and simple to install / 廉价、易安装 | Backbone break stops all traffic / 主干断裂全线瘫痪 |
4. Network Security Threats and Protection | 网络安全威胁与防护
Question 9: Define a denial-of-service (DoS) attack and describe one method used to carry it out. Answer: A DoS attack floods a server or network with excessive requests, overwhelming its resources so that legitimate users cannot access the service. A common method is a ping flood, where the attacker sends an enormous number of ICMP echo requests.
题目 9:定义拒绝服务(DoS)攻击,并描述一种实施方法。答案:DoS 攻击用超量请求淹没服务器或网络,耗尽资源,使合法用户无法访问服务。一种常见方法是 Ping 洪水,攻击者发送大量 ICMP 回显请求。
Question 10: Explain how a firewall helps protect a network. Answer: A firewall examines incoming and outgoing data packets against a set of security rules. It blocks unauthorized access and suspicious traffic, acting as a barrier between a trusted internal network and untrusted external networks.
题目 10:解释防火墙如何帮助保护网络。答案:防火墙根据安全规则检查进出的数据包,阻止未授权访问和可疑流量,充当可信内部网络与不可信外部网络之间的屏障。
Question 11: State two good password practices that help prevent unauthorised account access. Answer: Use a long password with a mix of upper and lower-case letters, digits and symbols (e.g., at least 12 characters). Do not reuse passwords across different services and change them regularly.
题目 11:列举两条有助于防止账户被未授权访问的密码好习惯。答案:使用由大小写字母、数字和符号组成的较长密码(比如至少 12 个字符)。不在不同服务中重复使用密码,并定期更换。
5. Algorithm Design and Representation | 算法设计与表示
Question 12: A program needs to output the largest of three numbers entered by the user. Write pseudocode to solve this problem. Answer:
INPUT num1, num2, num3
IF num1 >= num2 AND num1 >= num3 THEN
max ← num1
ELSE IF num2 >= num1 AND num2 >= num3 THEN
max ← num2
ELSE
max ← num3
END IF
OUTPUT max
题目 12:一个程序需要输出用户输入的三个数中的最大值。写出求解该问题的伪代码。答案:
输入 num1, num2, num3
如果 num1 >= num2 且 num1 >= num3 那么
max ← num1
否则如果 num2 >= num1 且 num2 >= num3 那么
max ← num2
否则
max ← num3
结束如果
输出 max
Question 13: Draw a flowchart symbol and name it for each of the following: process, decision, input/output. (In an exam, you would sketch them.) Answer: Process – rectangle; Decision – diamond; Input/Output – parallelogram.
题目 13:为以下各项画出流程图符号并命名:处理、判断、输入/输出。(考试中需要画图。)答案:处理——矩形;判断——菱形;输入/输出——平行四边形。
6. Programming Basics: Variables and Data Types | 编程基础:变量与数据类型
Question 14: Declare a variable to store a user's age. What data type would you choose and why? 6;). Integers are appropriate because age is a whole number, and most languages require no fractional precision for age.
题目 14:声明一个变量存储用户的年龄。你会选择哪种数据类型?为什么?答案:变量 age 应声明为整型(如 int age = 16;)。整型适合年龄,因为年龄是整数,且多数语言存储年龄不需要小数精度。
rogram uses a variable price = 9.99. What is the most suitable data type in most languages? mber. A double often provides greater precision, which is safer for currency calculations.
题目 15:程序中使用变量 price = 9.99。在多数语言中最合适的数据类型是什么?解释选择。答案:该变量应为浮点型(float 或 double),因为它存储带小数的数值。double 通常提供更高的精度,对货币计算更安全。
Question 16: Explain the difference between a local variable and a global variable. Answer: A local variable is declared inside a function or procedure and can only be accessed within that block. A global variable is declared outside all functions and can be read or modified by any part of the program.
题目 16:解释局部变量与全局变量的区别。答案:局部变量在函数或过程内部声明,只能在该代码块内访问。全局变量在所有函数之外声明,可被程序的任何部分读取或修改。
7. Control Structures: Sequence, Selection, Iteration | 控制结构:顺序、选择与迭代
Question 17: Write a Python-style loop that prints the numbers from 1 to 10. What type of loop is it? Answer: for i in range(1, 11): print(i) – this is a count-controlled loop (for loop) because it iterates a fixed number of times.
题目 17:写一个 Python 风格的循环,打印数字 1 到 10。这是什么类型的循环?答案:for i in range(1, 11): print(i) ——这是一个计数控制循环(for 循环),因为它按固定次数迭代。
rint(i); i = i + 1. This while loop repeats as long as the condition i <= 10 remains true.
题目 18:用条件控制循环重写上述代码。答案:i = 1; while i <= 10: print(i); i = i + 1。该 while 循环只要条件 i <= 10 成立就不断重复。
Question 19: A program checks whether a student's mark is >= 50. If true, display 'Pass', else display 'Fail'. Write an IF statement to implement this. Answer: IF mark >= 50 THEN OUTPUT 'Pass' ELSE OUTPUT 'Fail'.
题目 19:程序检查学生成绩是否 >= 50。若是则显示 'Pass',否则显示 'Fail'。编写 IF 语句实现。答案:IF mark >= 50 THEN 输出 'Pass' ELSE 输出 'Fail'。
8. Database Basics and SQL Queries | 数据库基础与 SQL 查询
Question 20: Define the terms 'primary key' and 'foreign key'. Answer: A primary key is a field that uniquely identifies each record in a table, e.g., StudentID. A foreign key is a field in one table that refers to the primary key of another table, establishing a relationship between tables.
题目 20:定义术语 '主键' 和 '外键'。答案:主键是唯一标识表中每条记录的字段,如 StudentID。外键是某个表中引用另一表主键的字段,用于建立表之间的关系。
e names and email addresses of all students from a table called Student where the grade is 'A'. Answer: SELECT Name, Email FROM Student WHERE Grade = 'A';
题目 21:写一条 SQL 语句,从名为 Student 的表中检索所有成绩为 'A' 的学生的姓名和电子邮件地址。答案:SELECT Name, Email FROM Student WHERE Grade = 'A';
Question 22: Explain why a flat-file database may lead to data redundancy. Answer: In a flat-file database, all data is stored in a single table. If a customer makes multiple orders, their personal details must be repeated for each order, causing duplication and potential inconsistency.
题目 22:解释为什么平面文件数据库可能导致数据冗余。答案:在平面文件数据库中,所有数据存在一张表里。如果某客户多次下单,其个人信息每笔订单都要重复存放,造成重复和潜在的不一致。
9. HTML and CSS Basics | HTML 与 CSS 基础
Question 23: Write the HTML tag to create a level 1 heading displaying 'My Website'. Answer: <h1>My Website</h1>
题目 23:写出显示 'My Website' 的一级标题的 HTML 标签。答案:<h1>My Website</h1>
Question 24: Explain the difference between inline CSS and an external style sheet. Answer: Inline CSS is written inside an HTML element's style attribute and affects only that element. An external style sheet is a separate .css file linked to the HTML page; it applies styles to multiple pages, promoting consistency and easier maintenance.
题目 24:解释内联 CSS 与外部样式表的区别。答案:内联 CSS 写在 HTML 元素的 style 属性内,只影响该元素。外部样式表是独立的 .css 文件,链接到 HTML 页面;可将样式应用于多个页面,保持一致性且易于维护。
Question 25: Write CSS code to set the background colour of a webpage to light blue and the text colour of all paragraphs to dark grey. Answer: body { background-color: lightblue; } p { color: darkgrey; }
题目 25:编写 CSS 代码,将网页背景设为浅蓝色,所有段落的文本颜色设为深灰色。答案:body { background-color: lightblue; } p { color: darkgrey; }
10. Software Testing and Debugging | 软件测试与调试
Question 26: Distinguish between syntax errors and logic errors with examples. Answer: A syntax error violates the programming language's grammar, e.g., missing a colon at the end of an if statement. A logic error produces unexpected results even though the code runs, e.g., using 'and' when 'or' was intended in a condition, giving wrong output.
题目 26:区分语法错误和逻辑错误,并举例。答案:语法错误违反编程语言的语法规则,例如 if 语句末尾漏掉冒号。逻辑错误在代码运行后得到非预期结果,例如条件中误用 'and' 而不是 'or',导致输出错误。
age = 25. Boundary data tests limits, e.g., age = 0 or 120. Exceptional data tests invalid inputs, e.g., age = -5. Together, they ensure the program handles all possible scenarios robustly.
题目 27:解释包含正常、边界和异常测试数据的用途。答案:正常数据测试典型使用场景,如 age = 25。边界数据测试极限值,如 age = 0 或 120。异常数据测试非法输入,如 age = -5。三者结合确保程序稳健处理所有可能情况。
Question 28: A developer finds that a program works on their computer but crashes on another machine. Suggest two environmental factors that could cause this. Answer: Different operating system versions or missing required software libraries; varying hardware resources such as insufficient RAM or processor speed.
题目 28:开发人员发现程序在自己电脑上运行正常,在另一台机器上却崩溃。提出两种可能的环境因素。答案:不同的操作系统版本或缺少所需的软件库;不同的硬件资源,如 RAM 不足或处理器速度不够。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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