📚 Year 10 OCR Computer Science: Case Study Practical Exercises | Year 10 OCR 计算机:案例分析实战演练
In OCR GCSE Computer Science, case studies and scenario-based questions test your ability to apply theoretical knowledge to real-world problems. This revision guide walks you through practical exercises that mirror exam-style tasks, covering decomposition, algorithm design, testing, data representation, and ethical considerations. Each section pairs an explanation with a worked example to build your confidence for the written papers and the programming project.
在 OCR GCSE 计算机科学中,案例研究和基于场景的问题会考察你将理论知识应用于实际问题的能力。本复习指南通过模拟考试类型的实操练习,带你走一遍问题分解、算法设计、测试、数据表示和伦理考量等环节。每个小节都将解释与示例配对,帮助你在笔试和编程项目中建立信心。
1. The Role of Case Studies in OCR Exams | 案例分析在 OCR 考试中的作用
Case studies in the OCR papers typically present a scenario such as a library system, a school registration app, or a fitness tracker. You are required to analyse requirements, propose solutions, and justify design choices. These questions assess computational thinking rather than mere knowledge recall.
OCR 试卷中的案例分析通常会给出一个场景,比如图书馆系统、学校注册应用程序或健身追踪器。你需要分析需求、提出解决方案并论证设计选择。这类题目评估的是计算思维,而不仅仅是知识记忆。
A strong response breaks the problem into manageable parts, uses appropriate notation, and always references the context. For example, when asked to design an algorithm for a library fine calculator, you need to consider inputs (days overdue, book type), processing (fine rate), and outputs (total fine).
一个优秀的回答会将问题分解成可管理的部分,使用合适的表示法,并始终联系上下文。例如,当要求为图书馆罚款计算器设计算法时,你需要考虑输入(逾期天数、图书类型)、处理(罚款费率)和输出(总罚款)。
2. Decomposition and Abstraction in Practice | 分解与抽象实践
Decomposition means breaking a complex problem into smaller, more manageable sub-problems. In a case study about a satnav app, you might decompose the system into route calculation, traffic data retrieval, and voice guidance. Each sub-problem can then be tackled individually.
分解是指将一个复杂问题拆解成更小、更易管理的子问题。在一个关于卫星导航应用的案例研究中,你可以将系统分解为路线计算、交通数据检索和语音引导。然后可以单独处理每个子问题。
Abstraction involves focusing on the essential details while ignoring irrelevant information. When modelling a student record, you would abstract to attributes like name, date of birth, and grades, ignoring physical characteristics. This simplifies the design of data structures and algorithms.
抽象则是指在建模时关注本质细节,忽略无关信息。在对学生记录建模时,你会抽象出姓名、出生日期和成绩等属性,忽略外貌特征。这样可以简化数据结构和算法的设计。
Let's apply both to a 'school canteen ordering system'. Decomposition identifies tasks: display menu, take order, calculate total, process payment. Abstraction defines key data: menu items with price and stock level, student ID and balance. The exam might ask you to describe how a student selects a meal without detailing the touchscreen hardware.
我们将这两者应用于“学校食堂点餐系统”。分解出任务:显示菜单、接受点餐、计算总价、处理支付。抽象定义关键数据:带价格和库存水平的菜单项、学生 ID 和余额。考试可能会要求你描述学生如何选择餐食,而无需详述触摸屏硬件。
3. Algorithm Design with Pseudocode | 算法设计与伪代码
OCR expects you to write pseudocode that is clear, unambiguous, and consistent with the exam reference language. A typical case study task: design an algorithm to find the highest score in a class list. You should use constructs like WHILE loops, IF statements, and arrays.
OCR 要求你编写清晰、无歧义且与考试参考语言一致的伪代码。典型的案例研究任务是:设计一个算法找出班级成绩列表中的最高分。你应该使用 WHILE 循环、IF 语句和数组等结构。
Below is a solution for a 'maximum score' algorithm, using a sentinel value of -1 to end input:
以下是一个“最高分”算法的解决方案,使用 -1 作为结束输入的哨兵值:
score ← 0
max ← 0
WHILE score ≠ -1
INPUT score
IF score > max THEN
max ← score
ENDIF
ENDWHILE
OUTPUT max
This pseudocode uses straightforward assignment and comparison. In a case study, you might need to extend it to handle multiple classes or validate inputs. Always comment your pseudocode to show understanding of the scenario.
该伪代码使用了直接的赋值和比较。在一个案例研究中,你可能需要扩展它以处理多个班级或验证输入。始终为伪代码添加注释,以展示你对场景的理解。
4. Flowcharts: Symbols and Real-World Scenarios | 流程图:符号与实际场景
Flowcharts provide a visual representation of algorithms, essential for communication in a team project. The OCR case study may ask you to draw or interpret a flowchart for a decision process, such as determining whether a student qualifies for a discount.
流程图提供了算法的可视化表示,在团队项目中对于沟通至关重要。OCR 案例研究可能会要求你绘制或解读一个决策过程的流程图,例如判断学生是否有资格获得折扣。
of control. For the discount example: input age, check if age < 18; if true, set discount = 10%, else discount = 0%.
你必须掌握的关键符号:椭圆形表示开始/结束,平行四边形表示输入/输出,矩形表示处理,菱形表示判断。箭头表示控制流。对于折扣示例:输入年龄,检查是否小于 18;如果为真,设置折扣为 10%,否则为 0%。
| Symbol | Meaning |
| Oval | Start / End |
| Parallelogram | Input / Output |
| Rectangle | Process |
| Diamond | Decision |
When drawing a flowchart by hand in the exam, use a ruler and label each symbol clearly. Practice translating a written scenario directly into a flowchart; this is a common top-mark discriminator.
在考试中手绘流程图时,使用尺子并清晰地标注每个符号。练习直接将文字场景转换为流程图;这是常见的区分高分的要点。
5. Designing a Test Plan | 设计测试计划
Every robust solution requires a test plan. In case study exercises, you are frequently asked to list test data along with expected outcomes and reasons for choosing that data. Test data falls into normal, boundary, invalid, and erroneous categories.
每个稳健的解决方案都需要一个测试计划。在案例研究练习中,你经常会被要求列出测试数据、预期结果以及选择这些数据的原因。测试数据分为正常、边界、无效和错误类别。
Consider a program that accepts a percentage score (0-100) and outputs a grade. Normal test: 75 should output 'Pass'. Boundary tests: 0, 100, and perhaps 50 if there is a grade boundary. Invalid test: -5 or 105; the program should display an error message. Erroneous test: entering 'abc' should be handled gracefully.
考虑一个接受百分制分数(0-100)并输出等级的程序。正常测试:75 应输出“通过”。边界测试:0、100,如果存在等级边界也可能测试 50。无效测试:-5 或 105;程序应显示错误消息。错误测试:输入“abc”应被妥善处理。
Your test plan table might look like:
| Test Type | Input | Expected Output | Reason |
| Normal | 75 | Pass | Mid-range value |
| Boundary | 0 | Fail | Lower limit |
| Invalid | -10 | Error message | Outside range |
Always link your test cases back to the requirements in the case study, showing that you have considered user needs and potential misuse.
始终将你的测试用例与案例研究中的需求联系起来,以表明你考虑了用户需求和潜在的误用情况。
6. Debugging Logic Errors in Context | 在上下文中调试逻辑错误
Exam scenarios often present a snippet of faulty code. You must identify the logic error and suggest a fix. For example, a while loop intended to sum numbers from 1 to 10 might forget to increment the counter, causing an infinite loop.
考试场景中常常会给出一个有错误的代码片段。你必须识别逻辑错误并提出修正方案。例如,一个用于求 1 到 10 之和的 while 循环可能忘记递增计数器,导致无限循环。
Trace tables are your best tool here. By stepping through the code manually with sample data, you can pinpoint where the output diverges from expectation. Practice building trace tables for algorithms involving arrays, sorting, and searching.
此时,追踪表是你最好的工具。通过使用示例数据手动逐步执行代码,你可以找出输出与预期不符的地方。练习为涉及数组、排序和搜索的算法构建追踪表。
s that the check uses a wrong upper bound; the fix is to change the condition to lesson time ≤ 15:30. Explaining this process in your answer demonstrates debugging skill.
在一个学校课程表案例研究中,验证程序可能允许在 17:00 安排课程,而这超出了上课时间。逻辑错误在于检查使用了错误的上限;解决方案是将条件改为上课时间 ≤ 15:30。在答案中解释这个过程可以展示你的调试技能。
7. Data Representation in Case Studies | 案例研究中的数据表示
Real-world scenarios often involve data storage and conversion. You might need to calculate the storage required for a library database or convert a colour code from hexadecimal to binary. Binary, denary, and hexadecimal conversions are fundamental.
实际场景常常涉及数据存储和转换。你可能需要计算图书馆数据库所需的存储空间,或将颜色代码从十六进制转换为二进制。二进制、十进制和十六进制之间的转换是基础。
For example, a fitness tracker records daily step counts as 16-bit unsigned integers. The maximum number of steps it can store is 216 6 = 4464. Understanding this helps you propose a solution, such as using a 32-bit integer.
例如,一个健身追踪器将每日步数记录为 16 位无符号整数。它可存储的最大步数是 216 - 1 = 65535。如果追踪器记录了 70000 步,就会发生溢出,导致计数回绕。利用公式:存储的值 = 70000 mod 65536 = 4464。理解这一点有助于你提出解决方案,如使用 32 位整数。
Also, consider representing characters using ASCII and Unicode. A case study about a messaging app that needs to support multiple languages must use Unicode (e.g., UTF-8) rather than extended ASCII. Be ready to justify memory and bandwidth implications.
此外,考虑使用 ASCII 和 Unicode 表示字符。一个关于需要支持多种语言的即时通讯应用的案例研究,必须使用 Unicode(如 UTF-8)而非扩展 ASCII。准备好解释内存和带宽方面的影响。
8. Networking and Security in Applied Contexts | 应用场景中的网络与安全
Case studies often embed networking issues. A business expanding to multiple offices may need a WAN connection. You could be asked to recommend a topology (e.g., star for reliability) and justify your choice. Consider factors like cost, scalability, and fault tolerance.
案例研究经常包含网络问题。一家向多个办公室扩展的企业可能需要广域网(WAN)连接。你可能会被要求推荐一种拓扑结构(如星形以保证可靠性),并论证你的选择。请考虑成本、可扩展性和容错性等因素。
Security is another exam focus. A scenario about an online banking portal raises questions about encryption, authentication, and malware prevention. Strong answers describe how asymmetric encryption establishes a secure connection, with reference to public and private keys. Also, mention SQL injection as a threat for any web form and how input sanitisation mitigates it.
安全是另一个考试重点。关于网上银行门户的场景会引出加密、身份验证和恶意软件预防等问题。优秀的答案会描述非对称加密如何建立安全连接,并提及公钥和私钥。此外,还应提及 SQL 注入是任何 Web 表单的威胁,以及输入清理如何缓解它。
A typical task: 'Explain how the company can protect customer data during transmission.' You need to link to HTTPS, SSL/TLS, and certificate authorities. Using precise technical vocabulary is rewarded.
一个典型的任务是:“解释该公司如何在传输过程中保护客户数据。”你需要联系到 HTTPS、SSL/TLS 和证书颁发机构。使用准确的技术词汇会得到加分。
9. Ethical, Legal, and Environmental Impacts | 伦理、法律与环境影响
OCR case studies require you to discuss wider issues. A system that uses facial recognition for school registration raises ethical concerns around privacy and consent. You must balance benefits (automated attendance) against drawbacks (biometric data storage, risk of misuse).
OCR 案例研究要求你讨论更广泛的问题。一个使用面部识别进行学校注册的系统会引发有关隐私和同意的伦理问题。你必须权衡好处(自动考勤)与弊端(生物特征数据存储、滥用风险)。
Legislation such as the Data Protection Act 2018 (UK GDPR) often appears. If a case study involves storing student personal data, you must explain principles like data minimisation, purpose limitation, and the right of access. The Computer Misuse Act is relevant if the scenario includes hacking or unauthorised access.
立法如《2018 年数据保护法》(英国 GDPR)经常出现。如果案例研究涉及存储学生个人数据,你必须解释数据最小化、目的限制和访问权等原则。若场景包含黑客攻击或未经授权的访问,则《计算机滥用法》相关。
Environmental impact can be woven in. A company upgrading servers should discuss e-waste disposal and the WEEE directive. You could suggest using cloud services to reduce hardware footprint and energy consumption. Demonstrating a balanced, informed view is key to top marks.
环境影响也可以融入其中。一家升级服务器的公司应讨论电子废物处理及 WEEE 指令。你可以建议使用云服务以减少硬件占用和能源消耗。展示均衡、有见地的观点是获得高分的关键。
10. Integrated Case Study: A Library Management System | 综合案例:图书馆管理系统
Let's consolidate all skills with a detailed example. Scenario: A school library wants a digital borrowing system. Books have ISBN, title, author, and status. Students have ID, name, and year group. A student can borrow up to 3 books at a time. Overdue fines are calculated at £0.10 per day for standard books and £0.20 for overnight loans.
让我们通过一个详细的示例来巩固所有技能。场景:一所学校图书馆希望建立一个数字借阅系统。图书有 ISBN、书名、作者和状态。学生有 ID、姓名和年级。学生一次最多可借 3 本书。逾期罚款标准书为每天 0.10 英镑,过夜借阅为 0.20 英镑。
Decomposition: sub-problems include searching for a book, checking loan limit, issuing a book, recording return, calculating fines, and generating overdues report. Abstraction: a Book record only needs ISBN, status (Available, On loan), and fine rate; a Student record needs ID, name, and current loans count.
分解:子问题包括搜索图书、检查借书限制、借出图书、记录归还、计算罚款和生成逾期报告。抽象:Book 记录只需 ISBN、状态(可用、借出)和罚款费率;Student 记录需要 ID、姓名和当前借书数量。
Pseudocode for the borrow function:
PROCEDURE borrow(studentID, ISBN)
IF student.loanCount ≥ 3 THEN
OUTPUT "Loan limit reached"
RETURN
ENDIF
IF book.status = "On loan" THEN
OUTPUT "Book unavailable"
RETURN
ENDIF
book.status ← "On loan"
student.loanCount ← student.loanCount + 1
recordDueDate(ISBN, TODAY + 14)
ENDPROCEDURE
Testing: normal case (valid student, available book), boundary (student with 2 loans borrowing one more), invalid (non-existent ISBN), erroneous (text entered for student ID). Ethical: data protection for student records, who has access to borrowing history. Legal: compliance with GDPR, retention of fines payment records. Environmental: encouraging e-books to reduce paper.
测试:正常情况(有效学生、可借图书)、边界情况(已借 2 本的学生再借一本)、无效情况(不存在的 ISBN)、错误情况(学生 ID 输入文本)。伦理:学生记录的数据保护,谁可以访问借阅历史。法律:遵守 GDPR,保留罚款支付记录。环境:鼓励电子书以减少纸张。
This integrated approach mirrors the multi-part questions in the exam and ensures you hit all assessment objectives.
这种综合方法与考试中的多部分问题相呼应,确保你覆盖了所有评估目标。
11. Exam Technique and Common Pitfalls | 考试技巧与常见误区
When tackling a case study question, always read the scenario twice and highlight key requirements. Allocate marks-based time; for a 6-mark question, plan 3-4 distinct points. Use the context in your answer – don't just give generic definitions.
在处理案例研究问题时,务必阅读场景两遍并标出关键要求。按分值分配时间;对于 6 分题,规划 3-4 个不同的要点。在答案中使用上下文——不要只给出笼统的定义。
Common pitfalls include writing pseudocode that is too language-specific, forgetting to close loops or IF statements, and overlooking boundary tests. Also, some students mix up ethical and legal issues; clearly separate them with proper definitions.
常见误区包括编写的伪代码过于接近特定语言、忘记闭合循环或 IF 语句、忽略边界测试。此外,有些学生会混淆伦理和法律问题;请用适当的定义将它们清晰分开。
Before the exam, practice with past paper case studies under timed conditions. The more you apply your knowledge to unfamiliar scenarios, the more agile your computational thinking becomes. Remember, OCR values structured, justified reasoning over a perfect single answer.
考试前,在计时条件下练习往年试卷的案例分析。你将知识应用于陌生场景的次数越多,你的计算思维就越灵活。请记住,OCR 看重的是结构清晰、有据可依的推理,而非完美无缺的单一答案。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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