IGCSE OCR Computer Science: Typical Exam Questions Explained | IGCSE OCR 计算机科学:典型例题详解

📚 IGCSE OCR Computer Science: Typical Exam Questions Explained | IGCSE OCR 计算机科学:典型例题详解

This article walks through ten typical IGCSE OCR Computer Science exam-style questions, explaining how to approach each one step by step. From number bases to networking and pseudocode, you will learn exactly what examiners look for and how to write clear, accurate answers.

本文将详细讲解十道 IGCSE OCR 计算机科学的典型考试题,逐步说明解题方法。从数制到网络、伪代码,你将准确理解考官的评分要点,学会写出清晰、准确的答案。

1. Binary to Denary Conversion | 二进制转十进制

Example question: Convert the binary number 11010110 to denary.

例题:将二进制数 11010110 转换为十进制。

Step 1: Write the place values above an 8‑bit row, starting from the rightmost bit (2⁰ = 1) and doubling leftwards: 128, 64, 32, 16, 8, 4, 2, 1.

第 1 步:在 8 位二进制上方写出位值,从最右端的位开始(2⁰ = 1),向左依次翻倍:128、64、32、16、8、4、2、1。

Step 2: Line up the binary digits under the place values. For 11010110: 1 under 128, 1 under 64, 0 under 32, 1 under 16, 0 under 8, 1 under 4, 1 under 2, 0 under 1.

第 2 步:将二进制数字与位值对齐。对于 11010110:128 下为 1,64 下为 1,32 下为 0,16 下为 1,8 下为 0,4 下为 1,2 下为 1,1 下为 0。

Step 3: Multiply each bit by its place value and add the results: (1×128) + (1×64) + (0×32) + (1×16) + (0×8) + (1×4) + (1×2) + (0×1) = 128 + 64 + 16 + 4 + 2 = 214.

第 3 步:将每一位乘以其位值,并将结果相加:(1×128) + (1×64) + (0×32) + (1×16) + (0×8) + (1×4) + (1×2) + (0×1) = 128 + 64 + 16 + 4 + 2 = 214。

Answer: 214 (denary).

答案:214(十进制)。

Common mistake: forgetting to include place values for zero bits. Always write out the full table to avoid skipping bits.

常见错误:忘记包含零位对应的位值。务必写出完整表格,避免遗漏。


2. Hexadecimal to Binary and Denary | 十六进制转二进制与十进制

Example question: Convert the hexadecimal value 3F into binary and then into denary.

例题:将十六进制数 3F 转换为二进制,再转换为十进制。

Step 1: Convert each hex digit to a 4‑bit nibble. 3 is 0011, F (denary 15) is 1111. Therefore, 3F in binary is 0011 1111, usually written as 111111 (8 bits).

第 1 步:将每个十六进制数字转换为 4 位二进制。3 是 0011,F(十进制 15)是 1111。因此,3F 的二进制为 0011 1111,通常写为 111111(8 位)。

Step 2: To convert binary 00111111 to denary, use place values: 128(0),64(0),32(1),16(1),8(1),4(1),2(1),1(1). Sum = 32+16+8+4+2+1 = 63.

第 2 步:将二进制 00111111 转为十进制,位值:128(0)、64(0)、32(1)、16(1)、8(1)、4(1)、2(1)、1(1)。求和 = 32+16+8+4+2+1 = 63。

Alternative: 3 × 16¹ + 15 × 16⁰ = 48 + 15 = 63 directly from hex.

另一种方法:直接从十六进制计算:3 × 16¹ + 15 × 16⁰ = 48 + 15 = 63。

Key point: Each hex digit expands to exactly 4 bits, which makes conversion fast. The exam may ask you to show working in both directions.

关键点:每个十六进制位恰好扩展为 4 个二进制位,使得转换迅速。考试可能要求展示双向转换过程。


3. Binary Addition and Overflow | 二进制加法与溢出

Example question: Add the 8‑bit binary numbers 10110110 and 01111001. State whether an overflow occurs and explain what it means.

例题:将 8 位二进制数 10110110 和 01111001 相加。说明是否发生溢出,并解释其含义。

Step 1: Perform binary addition from right to left, carrying when the sum of a column reaches 2 or 3.

第 1 步:从右向左进行二进制加法,当某一位的和达到 2 或 3 时进位。

Carry 1 1 1 1 0 1 0 0
A 1 0 1 1 0 1 1 0
B 0 1 1 1 1 0 0 1
Result 0 0 1 0 1 1 1 1

With 8 bits, we have an extra carry from the most significant bit (carry out = 1). The result inside the 8 bits is 00101111, but the true sum needs 9 bits.

在 8 位限制下,最高位产生了一个额外的进位(进位输出 = 1)。8 位内的结果为 00101111,但真正的和需要 9 位。

Step 2: Overflow has occurred because the result of adding two positive 8‑bit numbers (182 + 121 = 303) exceeds the maximum denary value representable with 8 bits (255). The stored value wraps around and becomes incorrect.

第 2 步:发生了溢出,因为两个正的 8 位数相加(182 + 121 = 303)超过了 8 位所能表示的最大十进制值(255)。存储的值会回绕,变得不正确。

Answer: Yes, overflow. It indicates the result is too large to fit in the allocated number of bits, leading to an inaccurate stored value.

答案:发生溢出。它表明结果过大,无法放入分配的位数,导致存储值不准确。


4. ASCII and Unicode | ASCII 与 Unicode

Example question: Explain why ASCII is sufficient for basic English text but Unicode is essential for global communication. Give an example of a character that Unicode can represent but ASCII cannot.

例题:解释为什么 ASCII 对于基础英文文本已足够,但全球通信必须使用 Unicode。举一个 Unicode 可以表示而 ASCII 无法表示的字符例子。

Explanation: ASCII uses 7 bits, providing 128 codes. It covers English letters (A–Z, a–z), digits 0–9 and common punctuation. However, it cannot encode characters from other scripts like Chinese, Arabic or emoji.

解释:ASCII 使用 7 位,提供 128 个码位,涵盖英文字母(A–Z,a–z)、数字 0–9 和常用标点。但它无法编码中文、阿拉伯文等其他书写系统的字符或表情符号。

Unicode uses up to 32 bits per character and can represent over 1.1 million code points. This allows it to include virtually all writing systems, mathematical symbols and emojis, ensuring consistent text display worldwide.

Unicode 每个字符最多使用 32 位,可表示超过 110 万个码点,因此能囊括几乎所有的书写系统、数学符号和表情符号,确保全球文本显示一致。

Example character: The Chinese character ‘汉’ (U+6C49) can be stored in Unicode (UTF‑8 or UTF‑16) but has no representation in ASCII.

字符例子:中文字符 ‘汉’ (U+6C49) 可以用 Unicode(UTF‑8 或 UTF‑16)存储,但在 ASCII 中没有表示。

Mark scheme tip: Always mention the bit width difference and the concept of limited versus extensive character sets.

评分提示:始终提及位宽差异,以及有限字符集与广泛字符集的概念。


5. Image File Size Calculation | 图像文件大小计算

Example question: An uncompressed bitmap image has a resolution of 1024 × 768 pixels and a colour depth of 24 bits. Calculate its file size in megabytes (MB).

例题:一幅未压缩的位图图像分辨率为 1024 × 768 像素,颜色深度为 24 位。计算其文件大小(MB)。

Step 1: Determine total pixels: 1024 × 768 = 786,432 pixels.

第 1 步:计算总像素数:1024 × 768 = 786,432 像素。

Step 2: Total bits = pixels × colour depth = 786,432 × 24 = 18,874,368 bits.

第 2 步:总位数 = 像素数 × 颜色深度 = 786,432 × 24 = 18,874,368 位。

Step 3: Convert bits to bytes: 18,874,368 ÷ 8 = 2,359,296 bytes.

第 3 步:位转字节:18,874,368 ÷ 8 = 2,359,296 字节。

Step 4: Convert bytes to kilobytes: 2,359,296 ÷ 1024 = 2,304 KB. Then to megabytes: 2,304 ÷ 1024 = 2.25 MB.

第 4 步:字节转千字节:2,359,296 ÷ 1024 = 2,304 KB。再转兆字节:2,304 ÷ 1024 = 2.25 MB。

File size (bytes) = (width × height × colour depth) / 8

Answer: 2.25 MB.

答案:2.25 MB。

Reminder: Unless the question states otherwise, use 1024 for conversions (1 KB = 1024 bytes, 1 MB = 1024 KB).

提醒:除非题目另有说明,否则使用 1024 进行换算(1 KB = 1024 字节,1 MB = 1024 KB)。


6. Sound File Size Calculation | 声音文件大小计算

Example question: A 30‑second stereo audio clip is recorded with a sample rate of 44.1 kHz and a 16‑bit sample resolution. Calculate the file size in kilobytes (KB) for an uncompressed recording.

例题:一段 30 秒的立体声音频以 44.1 kHz 采样率和 16 位采样精度录制。计算未压缩录音的文件大小(KB)。

Step 1: Calculate total samples: sample rate × duration = 44,100 × 30 = 1,323,000 samples per channel.

第 1 步:计算总样本数:采样率 × 时长 = 44,100 × 30 = 1,323,000 个样本(每声道)。

Step 2: Since stereo has 2 channels, total samples = 1,323,000 × 2 = 2,646,000 samples.

第 2 步:立体声有 2 个声道,总样本数 = 1,323,000 × 2 = 2,646,000 个样本。

Step 3: Total bits = samples × bit depth = 2,646,000 × 16 = 42,336,000 bits.

第 3 步:总位数 = 样本数 × 位深度 = 2,646,000 × 16 = 42,336,000 位。

Step 4: Convert to bytes: 42,336,000 ÷ 8 = 5,292,000 bytes. To KB: 5,292,000 ÷ 1024 ≈ 5,167.97 KB (or about 5.17 MB).

第 4 步:转为字节:42,336,000 ÷ 8 = 5,292,000 字节。转为 KB:5,292,000 ÷ 1024 ≈ 5,167.97 KB(约 5.17 MB)。

Answer: Approximately 5,168 KB.

答案:约 5,168 KB。

Exam tip: Always include the number of channels in your formula. Many students forget to multiply by 2 for stereo, costing marks.

考试提示:公式中一定要包含声道数。许多学生忘记为立体声乘以 2,导致丢分。


7. Logic Gates and Truth Tables | 逻辑门与真值表

Example question: Complete the truth table for the logic circuit with inputs A and B producing output Q = (A AND B) OR (NOT A).

例题:补全逻辑电路的真值表,输入为 A 和 B,输出 Q = (A AND B) OR (NOT A)。

Step 1: Determine intermediate column for A AND B. Then for NOT A. Finally, OR them.

第 1 步:确定中间列 A AND B,再求 NOT A。最后将它们相或。

A B A AND B NOT A Q = (A AND B) OR (NOT A)
0 0 0 1 1
0 1 0 1 1
1 0 0 0 0
1 1 1 0 1

Step 2: The completed truth table shows Q is 1 except when A = 1 and B = 0.

第 2 步:完整的真值表显示,除 A = 1 且 B = 0 时 Q = 0 外,其余情况 Q = 1。

Explanation: This circuit behaves like an OR where B matters only if A is true. It is a common pattern in logic simplification.

解释:该电路行为相当于一个“或”门,只有当 A 为真时 B 才起作用。这是逻辑化简中的常见模式。


8. Network Topologies: Star vs. Bus | 网络拓扑:星形与总线

Example question: Compare a star network topology with a bus topology in terms of reliability, performance and cost. Give a real‑world scenario where each is suitable.

例题:从可靠性、性能和成本方面比较星形拓扑与总线拓扑。分别给出适合每种拓扑的实际场景。

Star topology: Each device connects to a central switch/hub. If one cable fails, only that device disconnects – the rest of the network remains operational. Performance is consistent because collisions are rare with a switch. However, if the central device fails, the whole network goes down. It uses more cable, raising cost.

星形拓扑:每台设备连接到中央交换机/集线器。如果某条电缆故障,只有该设备断开,网络其余部分仍可正常运行。使用交换机时冲突少,性能稳定。但若中央设备故障,整个网络瘫痪。需使用更多电缆,成本较高。

Bus topology: All devices share a single backbone cable. It is cheap and easy to set up with less cable. But a break in the backbone brings down the whole network. Performance degrades with heavy traffic due to collisions.

总线拓扑:所有设备共享一根主干电缆。成本低,布线少,设置简单。但主干断裂会导致整个网络瘫痪。流量大时冲突增多,性能下降。

Scenarios: A school computer lab suits a star network for reliability and easy fault isolation. A small, temporary office with few devices can use a bus topology to save cost.

场景:学校计算机实验室适合星形网络,因可靠性高、易于隔离故障。具有少量设备的小型临时办公室可采用总线拓扑以节省成本。


9. SQL Query: Selecting Data | SQL 查询:选取数据

Example question: Given a table Students with fields StudentID, Name, Age and Form, write an SQL query to display the names of all students in Form ’11A’ who are older than 15.

例题:给定表格 Students,包含字段 StudentID、Name、Age 和 Form。编写 SQL 查询,显示 Form 为 ’11A’ 且年龄大于 15 的所有学生的姓名。

Solution: Use SELECT Name to choose the column. The condition is a combination using AND. The query is:

解答:使用 SELECT Name 选择列。条件使用 AND 组合。查询为:

SELECT Name FROM Students WHERE Form = ’11A’ AND Age > 15;

Step‑by‑step: FROM Students specifies the table. WHERE filters rows that meet both criteria. Only the Name column is returned.

逐步解释:FROM Students 指定表格。WHERE 筛选同时满足两个条件的行。仅返回 Name 列。

Caution: String values like ’11A’ must be enclosed in single quotes. Numerical comparisons (Age > 15) do not use quotes.

注意:类似 ’11A’ 的字符串值必须用单引号括起来。数值比较(Age > 15)不要用引号。

If the question asks for unique names, add DISTINCT: SELECT DISTINCT Name …

如果题目要求不重复的姓名,应添加 DISTINCT:SELECT DISTINCT Name …


10. Pseudocode: Condition‑Controlled Loop | 伪代码:条件控制循环

Example question: Write pseudocode that repeatedly asks the user to enter a number. The program stops when the user enters 0 and then outputs the sum of all numbers entered before 0.

例题:编写伪代码,反复要求用户输入一个数。当用户输入 0 时程序停止,然后输出在 0 之前输入的所有数的总和。

Solution: A REPEAT…UNTIL loop is ideal because the loop must execute at least once. The pseudocode can be written as:

解答:REPEAT…UNTIL 循环最为合适,因为循环体至少需要执行一次。伪代码可写为:

Total ← 0
REPEAT
  OUTPUT “Enter a number:”
  INPUT Num
  IF Num ≠ 0 THEN
    Total ← Total + Num
  ENDIF
UNTIL Num = 0
OUTPUT “Sum is “, Total

Explanation: The variable Total accumulates valid inputs. The loop continues until Num equals 0. When 0 is entered, the addition is skipped and the loop exits, then the sum is displayed.

解释:变量 Total 累加有效输入。循环持续到 Num 等于 0。当输入 0 时,跳过加法,退出循环,然后显示总和。

Mark scheme notes: Use clear indentation, correct assignment arrows (←), and ensure the termination condition is correctly placed. Accept alternative WHILE‑loop syntax if equally correct.

评分说明:清晰缩进、正确的赋值箭头(←)、妥善设置终止条件。如果用 WHILE 循环并且正确,也可得分。


Published by TutorH

Published by TutorHao | IGCSE 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课程辅导,国外大学本科硕士研究生博士课程论文辅导

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