📚 Case Study Practice Drill | 案例分析实战演练
Case study questions are a core component of the WJEC GCSE Computer Science assessment. They require you to read a real‑world scenario, identify the computational problem, and design, develop and evaluate a solution. This drill will build your confidence by breaking down the process into manageable steps and giving you a realistic practice scenario.
案例分析题是 WJEC GCSE 计算机科学考试的核心组成部分。这类题目要求你阅读一个真实世界场景,识别其中的计算问题,并设计、开发及评估解决方案。本次演练将通过把解题过程分解成易于掌握的步骤,并附带一个仿真练习场景,帮助你建立信心。
1. Understanding Case Studies in WJEC | 理解WJEC考试中的案例分析题
In the WJEC specification, case studies appear mainly in Component 2: Computational Thinking and Programming. You will be given a description of a situation – such as a library system, a mobile app or an online ordering process – and you are expected to apply abstraction, decomposition, algorithm design and evaluation skills.
在 WJEC 考试大纲中,案例分析主要出现在试卷二:计算思维与编程。你会得到一段情境描述,比如图书馆系统、手机应用或者在线订购流程,并需要运用抽象、分解、算法设计和评估等技能。
The marks are awarded not only for a working algorithm but also for how well you can explain your reasoning, identify patterns and test your solution. Success comes from practising the same structured approach every time.
评分不仅取决于算法是否正确,还看你能否清晰解释解题思路、识别模式并测试解决方案。每次练习都遵循相同的结构化方法,是成功的关键。
2. The Importance of Decomposition | 问题分解的重要性
Decomposition means breaking a large, complex problem into smaller, more manageable sub‑problems. When you read a case study, your first task is to list all the separate tasks the system must perform. For example, in a ticket booking system, sub‑problems might include: checking seat availability, calculating total cost, updating the seating plan and issuing a confirmation.
分解是指将一个庞大复杂的问题拆分成更小、更易于管理的子问题。阅读案例分析时,你的第一个任务就是列出系统必须完成的所有独立任务。例如,在票务预订系统中,子问题可能包括:检查座位可用性、计算总费用、更新座位图和发送确认信息。
By solving each sub‑problem individually, you avoid being overwhelmed and can focus on writing clear, modular pseudocode. The WJEC mark scheme rewards candidates who demonstrate a logical breakdown of the problem.
通过逐一解决每个子问题,你就不会被整体复杂性压垮,并且能够专注于编写清晰、模块化的伪代码。WJEC 评分标准会奖励那些展示出逻辑分解能力的考生。
3. Pattern Recognition & Abstraction | 模式识别与抽象
Once the sub‑problems are identified, look for patterns. Are there repetitions or similarities? For instance, a shopping cart might need to apply discount rules to multiple items – the same calculation pattern repeats. Recognising this allows you to write a repeated loop or a reusable function rather than duplicate code.
确定子问题后,要寻找模式。是否存在重复或相似之处?例如,购物车可能需要为多个商品应用折扣规则——相同的计算模式会反复出现。识别出这种模式后,你就可以编写一个循环或可复用的函数,而不是重复编写代码。
Abstraction involves filtering out unnecessary detail and focusing on the essential features. In your algorithm, you do not need to simulate every mouse click – you only model the data and the logical steps that transform the inputs into the desired outputs. Good abstraction makes your pseudocode concise and exam‑friendly.
抽象则是滤除不必要的细节,只关注本质特征。在你的算法中,不需要模拟每一次鼠标点击——你只需要对数据以及将输入转换为所需输出的逻辑步骤进行建模。良好的抽象能让你的伪代码变得简洁,符合考试要求。
4. Algorithm Design Fundamentals | 算法设计基础
Every WJEC case study solution must include an algorithm expressed in pseudocode or a flowchart. The algorithm should be sequential, use appropriate selection (IF…THEN…ELSE) and iteration (WHILE, FOR) constructs, and handle data input and output.
每一个 WJEC 案例分析题答案都必须包含用伪代码或流程图表示的算法。算法应当是顺序执行的,使用恰当的选择结构(IF…THEN…ELSE)和循环结构(WHILE、FOR),并处理数据的输入与输出。
Remember that your algorithm must be unambiguous. An examiner should be able to follow your steps from start to finish without guessing. Always initialise variables and define the end condition of any loop clearly.
请记住,你的算法必须是明确的。考官应当能够从头到尾毫无歧义地跟随你的步骤。务必初始化变量,并清楚地定义任何循环的终止条件。
5. Pseudocode Conventions | 伪代码规范
WJEC accepts a standard pseudocode style. Use the following conventions to keep your answers clear:
WJEC 接受一种标准的伪代码风格。使用以下规范能让你的答案更清晰:
- INPUT and OUTPUT for data entry and display
- INPUT 和 OUTPUT 用于数据输入与显示
- Assignment with ← (e.g. total ← price * quantity)
- 使用 ← 进行赋值(例如 total ← price * quantity)
- IF condition THEN … ELSE … ENDIF
- IF 条件 THEN … ELSE … ENDIF
- WHILE condition DO … ENDWHILE
- WHILE 条件 DO … ENDWHILE
- FOR index ← start TO finish DO … ENDFOR
- FOR 索引 ← 起始值 TO 结束值 DO … ENDFOR
- Use meaningful variable names like itemCost, finalTotal
- 使用有意义的变量名,例如 itemCost、finalTotal
Consistency is more important than strict syntax, but a clean layout with indentation will help the examiner follow your logic.
一致性比严格的语法更重要,但带有缩进的整洁布局有助于考官跟上你的逻辑。
6. Testing & Trace Tables | 测试与跟踪表
A trace table is a manual testing tool that records the value of each variable at every step of your algorithm. It helps you verify that the logic produces the expected results and allows you to catch off‑by‑one errors or incorrect condition checks.
跟踪表是一种手动测试工具,用于记录算法每一步中各个变量的值。它能帮你验证逻辑是否产生了预期结果,并且能让你发现差一错误或错误的条件判断。
Below is an example of a simple trace table for a discount algorithm:
下面是一个折扣算法跟踪表的简单示例:
| Step | price | quantity | total | discount | final |
|---|---|---|---|---|---|
| 1 | 25 | 4 | 100 | 0 | – |
| 2 | 25 | 4 | 100 | 10 | – |
| 3 | 25 | 4 | 100 | 10 | 90 |
In the exam, you may be asked to complete a trace table for a given algorithm. Practise by tracing your own pseudocode with sample data.
在考试中,你可能会被要求为某个给定算法完成跟踪表。通过用样例数据追踪自己的伪代码来进行练习。
7. Real‑World Scenario: Online Shopping System | 真实场景:在线购物系统
To apply the techniques, we will work through a realistic WJEC‑style case study. Imagine an online shop that sells two types of products: ‘Standard’ and ‘Premium’. The system must calculate the final price after applying the following rules:
为了应用这些技巧,我们将演练一个逼真的 WJEC 风格案例。假设有一家网店销售两类产品:“标准”和“高级”。系统需要根据以下规则计算最终价格:
- Take the unit price and quantity for each item
- 获取每种商品的单价与数量
- Standard items get no automatic discount; Premium items receive a 15% discount if the quantity ordered is 5 or more
- 标准商品没有自动折扣;高级商品如果订购数量达到 5 件或以上,则享受 15% 折扣
- If the total before any discount exceeds £200, an additional £20 voucher is applied to the final total
- 如果折扣前总金额超过 200 英镑,则额外在最终总价上减免 20 英镑
- The system should output an itemised summary and the final payable amount
- 系统应输出分项摘要与最终应付金额
This scenario includes decision trees, arithmetic operations and output formatting – all typical of WJEC case studies.
这个场景包含了决策树、算术运算和输出格式化,全部都是 WJEC 案例分析中的典型内容。
8. Designing a Solution Step by Step | 逐步设计解决方案
First, we decompose the problem:
首先,我们对问题进行分解:
- Input: product type (Standard/Premium), unit price, quantity
- 输入:产品类型(标准/高级)、单价、数量
- Process: calculate item total, apply premium discount, sum subtotals, apply voucher
- 处理:计算单项总额、应用高级折扣、求和子总计、应用代金券
- Output: display each item’s details and the final amount
- 输出:显示每项商品的详情及最终金额
Next, we abstract away unnecessary details – we ignore stock levels, user interface colours and payment gateways. The algorithm focuses purely on the computational logic.
接着,我们抽象掉不必要的细节——忽略库存水平、用户界面颜色和支付网关。算法只专注于计算逻辑。
Here is one possible pseudocode solution:
以下是一种可能的伪代码解决方案:
totalBeforeDiscount ← 0
itemSummary ← ""
FOR i ← 1 TO number_of_items DO
INPUT productType, unitPrice, quantity
itemTotal ← unitPrice * quantity
discountPercent ← 0
IF productType = "Premium" AND quantity >= 5 THEN
discountPercent ← 15
ENDIF
discountAmount ← itemTotal * discountPercent / 100
discountedItemTotal ← itemTotal - discountAmount
totalBeforeDiscount ← totalBeforeDiscount + discountedItemTotal
itemSummary ← itemSummary + productType + ": £" + STRING(discountedItemTotal) + "\n"
ENDFOR
finalTotal ← totalBeforeDiscount
IF totalBeforeDiscount > 200 THEN
finalTotal ← finalTotal - 20
ENDIF
OUTPUT itemSummary
OUTPUT "Final payable: £" + STRING(finalTotal)
The pseudocode uses a FOR loop to process multiple items, a decision block for the Premium discount, and a conditional voucher application. All variables are clearly initialised.
这段伪代码使用 FOR 循环处理多件商品,一个决策块实现高级折扣,以及一个条件代金券应用。所有变量都被清晰地初始化了。
9. Evaluating the Solution | 评估解决方案
Evaluation is an essential part of the WJEC mark scheme. You should test your algorithm with normal, boundary and erroneous data. For the shopping system, consider these test cases:
评估是 WJEC 评分标准中必不可少的部分。你需要用正常数据、边界数据和错误数据来测试算法。对于这个购物系统,可以考虑以下测试用例:
- Normal: 3 Premium items with quantity 6 → expects 15% discount
- 正常:3 件高级商品,数量 6 → 预期获得 15% 折扣
- Boundary: totalBeforeDiscount exactly 200 → no voucher applied; 201 → voucher applied
- 边界:折扣前总额恰好为 200 → 不触发代金券;201 → 触发代金券
- Erroneous: negative quantity or non‑numeric input → the algorithm as written lacks validation, which is a weakness you could discuss
- 错误:负数数量或非数字输入 → 当前编写的算法缺少验证,这正是一个可以讨论的弱点
By identifying limitations, you demonstrate higher‑order thinking. You could suggest adding an input validation loop and handling the case when the final total becomes negative after the voucher.
指出局限性可以展示高阶思维。你可以建议增加一个输入验证循环,并处理代金券减免后最终金额变为负数的情况。
10. Common Mistakes to Avoid | 避免常见错误
Many students lose marks in case study questions through avoidable errors. The most frequent mistakes include:
许多学生因为可避免的错误而在案例分析题中丢分。最常见的错误包括:
- Forgetting to initialise a running total or counter (e.g. totalBeforeDiscount ← 0)
- 忘记初始化累加总和或计数器(例如 totalBeforeDiscount ← 0)
- Using = instead of ← for assignment, which can confuse the meaning
- 使用 = 而非 ← 进行赋值,可能造成含义混淆
- Writing ambiguous conditions: using ‘discount if item is Premium and quantity 5’ does not specify whether quantity must be exactly 5 or at least 5
- 写出含糊的条件:例如“如果商品为高级且数量 5 则打折”未指明数量是等于 5 还是大于等于 5
- Not closing selection and iteration structures with ENDIF, ENDWHILE or ENDFOR
- 没有用 ENDIF、ENDWHILE 或 ENDFOR 闭合选择和循环结构
- Ignoring output formatting requirements, such as displaying the final amount with a currency symbol
- 忽略输出格式要求,例如最终金额是否需要带上货币符号
Review your pseudocode with a checklist of these pitfalls before declaring it complete.
在宣告伪代码完成之前,对照这份常见错误清单逐一复查。
11. Practice Drill with a Sample Question | 附带样题的实战练习
Now try this fresh scenario under timed conditions (15–20 minutes). A school canteen wants a program where students enter their meal choice and year group. ‘Junior’ (Years 7‑9) meals cost £2.50, ‘Senior’ (Years 10‑11) meals cost £3.00. If a student buys 5 or more meals in a week, they receive a 10% loyalty discount on the total. Write an algorithm that asks for the year group, number of meals that week, and outputs the total cost.
现在请在限时条件下(15–20 分钟)尝试这个全新场景。学校食堂想要一个程序:学生输入他们的餐食选择和年级组。“初中”(7–9 年级)每餐 2.50 英镑,“高中”(10–11 年级)每餐 3.00 英镑。如果一名学生在一周内购买 5 餐或以上,即可获得总价 10% 的忠诚折扣。请编写一个算法,询问年级组和该周用餐数量,并输出总费用。
After writing your pseudocode, create a trace table for a Junior student buying 6 meals and a Senior student buying 3 meals. Compare your output with your trace table predictions.
编写完伪代码后,为一名购买 6 餐的初中生和一名购买 3 餐的高中生分别制作跟踪表。将你的输出与跟踪表预测结果进行比较。
12. Tips for Timed Conditions | 限时条件下的技巧
Case study questions can look intimidating when the clock is ticking. Use this battle plan:
时间滴答流逝时,案例分析题可能看起来令人生畏。请采用以下作战计划:
- Spend the first 3 minutes reading and underlining key requirements – circle figures, decision rules and output formats.
- 花最初 3 分钟阅读题目并划出关键要求——圈出数字、决策规则和输出格式。
- Jot down a decomposition list in the margin: inputs, processes, outputs.
- 在空白处快速列出分解清单:输入、处理、输出。
- Write the pseudocode in rough first, then copy it neatly into the answer space, checking for ENDIF/ENDFOR closures.
- 先在草稿纸上写伪代码,再整洁地誊写到答题区域,同时检查 ENDIF/ENDFOR 等闭合。
- Leave 5 minutes to trace at least one set of test data – this often reveals logical errors.
- 留出 5 分钟至少追踪一组测试数据——这往往会暴露逻辑错误。
- If you get stuck, move on to the next sub‑question and return later; partial marks are available for correct decomposition even if the full algorithm is incomplete.
- 如果一时卡住,先做下一小问,之后再回头;即使完整算法未完成,正确的分解也能获得部分分数。
Regular drilling with different scenarios will make this process automatic by the time you enter the exam hall.
用不同场景进行定期演练,到进入考场时,这套流程就会变得自然而然。
Published by TutorHao | WJEC Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导