📚 Year 12 WJEC Computer Science: Mastering the On-Screen Practical Exam | WJEC 计算机 AS 实践编程考核要点
The WJEC AS Computer Science Unit 2 on-screen exam challenges you to apply programming skills, algorithmic thinking and systematic testing to solve real-world problems within a strict time limit. Success depends not just on knowing syntax, but on understanding how to break down a problem, design a clear solution, write robust code and verify it works correctly. This article brings together the key practical assessment points every Year 12 student should master before sitting the examination.
WJEC AS 计算机科学单元二的机考要求你在严格的时间限制内运用编程技能、算法思维和系统化测试去解决真实情境问题。成功不仅取决于记住语法,更在于你如何拆解问题、设计清晰的解决方案、编写健壮的代码并验证其正确性。本文汇总了每一位 Year 12 学生考前必须掌握的实践考核要点。
1. Understanding the WJEC AS Unit 2 Exam Format | 理解 WJEC AS 单元二考试形式
The on-screen exam lasts 2 hours and typically consists of three tasks. Task 1 asks you to analyse a scenario and produce a design – often a flowchart or pseudocode. Task 2 requires you to write, edit and run code to implement your design. Task 3 involves testing your solution, evaluating its limitations and suggesting improvements. The exam is conducted on a computer with your chosen programming language (Python, C#, Java or VB.NET) and an approved IDE, but with no internet access.
机考时间为 2 小时,通常包含三个任务。任务一要求你分析场景并产出一份设计方案——通常是流程图或伪代码。任务二需要你编写、修改并运行代码以实现设计方案。任务三涉及测试你的解法、评估其局限性并提出改进建议。考试在计算机上进行,使用你选择的编程语言(Python、C#、Java 或 VB.NET)和认可的 IDE,但无法访问互联网。
Your design in Task 1 carries significant marks and directly influences how quickly you can code in Task 2. Do not rush into coding. Spend at least 20–25 minutes on thorough analysis and design, identifying inputs, outputs, processes and any special conditions. A clear structure reduces mistakes later.
任务一的设计占分可观,并直接影响你在任务二编码的效率。切勿急于编写代码。至少留出 20 至 25 分钟进行充分的分析和设计,明确输入、输出、处理步骤以及特殊条件。清晰的结构能减少后期错误。
All tasks are marked against WJEC assessment objectives: AO2 (apply knowledge), AO3 (design, develop and evaluate). The exam rewards logical thinking, correct use of programming constructs and evidence of systematic testing, not just a working program.
所有任务均按照 WJEC 评估目标评分:AO2(应用知识)、AO3(设计、开发和评价)。考试奖励逻辑思维、正确使用编程结构以及系统化测试的证据,而不仅仅是能够运行的程序。
2. Algorithmic Thinking and Problem Decomposition | 算法思维与问题分解
Before writing a single line of code, you must be able to decompose a problem into smaller, manageable sub-problems. Start by listing all tasks the program must perform. Then identify dependencies: which parts must be completed before others? This top-down design is fundamental and is often assessed through your pseudocode or flowchart in Task 1.
在写任何一行代码之前,你必须能将问题分解为更小、可控制的子问题。首先列出程序必须执行的全部任务,然后明确依赖关系:哪些部分必须先完成?这种自顶向下的设计方法是基础,并经常在任务一的伪代码或流程图中加以考查。
Practise converting written specifications into structured pseudocode. Use common conventions: INPUT, OUTPUT, IF…THEN…ELSE, WHILE…ENDWHILE, FOR…ENDFOR. Avoid vague language; your pseudocode must be precise enough that another programmer could implement it without ambiguity. Flowcharts should use correct symbols – ovals for start/end, parallelograms for input/output, rectangles for processes and diamonds for decisions.
练习将书面规格说明转化为结构化的伪代码。使用常规约定:INPUT、OUTPUT、IF…THEN…ELSE、WHILE…ENDWHILE、FOR…ENDFOR。避免模糊语言;伪代码必须足够精确,让另一位程序员能无歧义地实现。流程图应使用正确符号——椭圆表示开始/结束,平行四边形表示输入/输出,矩形表示处理步骤,菱形表示判断。
3. Mastering Programming Fundamentals | 掌握编程基础
Solid control of data types is essential. You must confidently declare and initialise integers, real numbers, Booleans, characters and strings. Understand type conversion, both implicit and explicit (casting), because mixing types – especially during input – causes runtime errors. Always consider what data type a variable should hold before you create it.
扎实掌握数据类型至关重要。你必须自信地声明并初始化整型、实数、布尔值、字符和字符串。理解隐式和显式类型转换(强制转换),因为混合类型——特别是在输入时——会导致运行时错误。创建变量之前,一定要先考虑它应该保存什么数据类型。
Selection and iteration structures form the backbone of problem-solving. Use IF, ELSE IF and ELSE for conditional branching; remember to test boundary conditions. For loops, choose definite iteration (FOR) when the number of repetitions is known in advance, and indefinite iteration (WHILE, REPEAT…UNTIL) when the loop continues until a condition is met. Nested structures are very common in exam problems, so practise combining loops and conditionals without losing track of variable scope.
选择与迭代结构是解决问题的骨架。使用 IF、ELSE IF 和 ELSE 实现条件分支;记得测试边界条件。对于循环,当重复次数预先已知时选用确定迭代(FOR),当循环持续到某一条件满足时选用不定迭代(WHILE、REPEAT…UNTIL)。嵌套结构在考题中非常常见,因此要练习组合循环和条件分支,同时不丢失变量作用域的掌控。
Modular programming is rewarded. Break your code into procedures and functions with clear interfaces. Functions should return a value and avoid side effects. Use meaningful identifier names, and add concise comments to explain the purpose of each module, especially where logic is complex.
模块化编程会获得加分。将代码拆分为具有清晰接口的过程和函数。函数应返回值并避免副作用。使用有意义的标识符命名,并添加简洁注释来说明每个模块的用途,特别是在逻辑复杂的地方。
4. Working with Data Structures | 运用数据结构
One-dimensional arrays (lists) are the most commonly tested data structure. You must be able to declare an array, populate it using a loop or direct assignment, traverse it, search for a value (linear search) and find the maximum or minimum. Practise operations such as counting occurrences, summing elements and building a new array from filtered values.
一维数组(列表)是最常考的数据结构。你必须能声明数组,用循环或直接赋值填充,遍历,搜索某个值(线性搜索)以及找到最大值或最小值。练习统计出现次数、求和元素、从筛选值构建新数组等操作。
You should also be comfortable with two-dimensional arrays for problems like grids, game boards or seating plans. Accessing elements requires nested loops: the outer loop for rows and the inner loop for columns. WJEC may ask you to manipulate such a structure, e.g. count adjacent cells or calculate row totals.
你还应该熟悉二维数组,用于网格、游戏棋盘或座次表等问题。访问元素需要嵌套循环:外层循环对应行,内层循环对应列。WJEC 可能会要求操作此类结构,例如统计相邻单元格或计算行总和。
For higher marks, show awareness of records (or classes). Define a record structure to group related data of different types – for instance, a Student record with name, age and grade. Accessing and updating fields demonstrates abstraction and organised thinking.
若要取得更高分数,应表现出对记录(或类)的认知。定义记录结构以组合不同类型的相关数据——例如,一个包含姓名、年龄和成绩的 Student 记录。访问和更新字段能够展示抽象能力和有组织的思维。
5. File Handling and External Data | 文件处理与外部数据
Many practical problems involve reading from or writing to a text file. You must know how to open a file in read, write or append mode, read lines one by one or all at once, split strings into useful tokens, and close the file properly. Always plan for scenarios such as missing files or empty files so your code does not crash unexpectedly.
许多实践问题涉及从文本文件读取或向文本文件写入。你必须知道如何以读取、写入或追加模式打开文件,逐行读取或一次性全部读取,将字符串拆分成有用的标记,并正确关闭文件。始终为文件缺失或文件为空的场景做好预案,以避免代码意外崩溃。
Practise processing CSV-style data: splitting each line on a delimiter, converting numeric tokens to the correct type, and handling malformed lines gracefully. You may be required to search for records, update values or output filtered results to a new file. These operations combine file handling with array/record processing, making them ideal exam tasks.
练习处理 CSV 风格的数据:基于分隔符拆分每一行,将数字标记转换为正确类型,并妥善处理格式错误的行。考试可能要求你搜索记录、更新值或把筛选结果输出到新文件。这些操作结合了文件处理与数组/记录处理,是理想的出题方向。
6. Input Validation and Error Handling | 输入验证与错误处理
Robust programs guard against invalid user input. Always assume the user might type letters where numbers are expected, enter numbers outside an allowed range, or leave input blank. Use defensive design: check input length, type and range before processing. Loops that re-prompt until valid input is received are a standard pattern.
健壮的程序能防范无效的用户输入。始终假设用户可能会在需要数字的地方输入字母、输入超出允许范围的数值或留空。使用防御性设计:在处理前检查输入的长度、类型和范围。循环重复提示直到收到有效输入是一个标准模式。
Typical validation techniques include presence checks, type checks, range checks, length checks and format checks (e.g. using patterns). In the exam, even basic validation—like rejecting negative ages or empty names—earns marks. For higher bands, incorporate try–except structures where your language supports them, to catch errors without crashing the program.
典型的验证技术包括存在检查、类型检查、范围检查、长度检查和格式检查(如使用模式)。在考试中,即使是基本的验证——比如拒绝负的年龄或空的姓名——也能得分。在高分段,可以在语言支持的地方引入 try–except 结构,以捕获错误而不让程序崩溃。
7. Debugging Techniques | 调试技巧
ction by commenting out code or using temporary print statements to display variable values. Check whether the logic matches your original pseudocode. Common mistakes include off-by-one errors in loops, misusing assignment (=) instead of equality (==), and failing to update loop counters.
在时间紧迫的考试环境中,错误不可避免。建立系统化的方法:首先重现错误,然后通过注释掉代码或使用临时打印语句显示变量值来隔离出错区域。检查逻辑是否与最初伪代码一致。常见错误包括循环中的 off-by-one 错误、误用赋值(=)代替相等比较(==)以及忘记更新循环计数器。
Trace tables are an underused but powerful debugging tool. Even in the on-screen exam, you can quickly jot down a trace table on paper or in the answer booklet to follow how variables change during loop iterations. This often reveals exactly where logic goes wrong. Mentioning or using trace tables in Task 3 can also strengthen your evaluation marks.
跟踪表是一种被低估但极为强大的调试工具。即使在机考中,你也能在纸上或答题册中快速画出跟踪表,追踪循环迭代期间变量如何变化。这经常能准确揭示逻辑出错的位置。在任务三中提及或使用跟踪表也能增强你的评价得分。
8. Testing Methodologies | 测试方法
Testing is an explicit component of Task 3 and carries its own marks. You must go beyond “it works”. Use a mixture of test types: normal data (typical expected values), boundary data (values at the limits of acceptable ranges, e.g. 0, maximum, minimum), and erroneous data (values that should be rejected). For each test case, document the input, expected outcome and actual outcome.
测试是任务三的明确组成部分,自带分值。你必须超越“程序能运行”的程度。混合使用不同测试类型:正常数据(典型的期望值)、边界数据(可接受范围极限处的值,例如 0、最大值、最小值)以及错误数据(应被拒绝的值)。对每个测试用例,记录输入、预期结果和实际结果。
If your program produces unexpected output, do not simply comment “it failed”. Analyse why the failure occurred, link it back to your design, and describe a realistic fix. This shows AO3 evaluation skills. Where possible, re-run the test after fixing to confirm the issue is resolved—this is retesting, not regression testing, but it shows thoroughness.
如果你的程序产生了意料之外的输出,不要仅仅评注“它失败了”。分析失败发生的原因,将其与设计关联起来,并描述一个可行的修正方案。这展现了 AO3 评价技能。如果可能,在修正后重新运行测试以确认问题已解决——这属于重新测试,虽非回归测试,但能体现严谨性。
9. Efficiency and Code Optimisation | 效率与代码优化
While the WJEC AS Unit 2 exam does not require deep complexity analysis, you should be aware of algorithmic efficiency. Avoid unnecessarily repeating the same calculation inside loops; compute it once and store the result. Use sensible loop termination conditions so your program does not waste time on irrelevant iterations. Mentioning these considerations in your evaluation earns higher marks.
虽然 WJEC AS 单元二考试不要求深入的复杂度分析,但你应当关注算法效率。避免在循环内不必要地重复同一计算;一次算出并存储结果。使用合理的循环终止条件,让程序不浪费时间在无关迭代上。在评价中提及这些考虑能够获得更高分数。
Recognise that different problems benefit from different approaches. For a list that is already sorted, a binary search is much faster than a linear search. If you are repeatedly searching the same unsorted list, consider sorting it first to enable binary searching later. Explaining such design choices in Task 3 highlights deeper understanding.
认识到不同的问题受益于不同的方法。对于已排序的列表,二分查找比线性查找快得多。如果要重复搜索同一个未排序列表,考虑先将其排序以支持后续二分查找。在任务三中解释这样的设计选择能突出更深入的理解。
10. Common Pitfalls and How to Avoid Them | 常见陷阱及规避方法
One frequent pitfall is mismanaging array indices. Arrays often start at index 0; using index 1 can skip the first element or cause an out-of-bounds error. Always verify the lower and upper bounds before accessing an element. Another pitfall is forgetting to convert string input to numeric types before arithmetic operations, leading to concatenation instead of addition.
一个常见陷阱是错误管理数组索引。数组通常从索引 0 开始;使用索引 1 可能跳过第一个元素或引发越界错误。始终在访问元素前验证下界和上界。另一个陷阱是忘记在算术运算前将字符串输入转换为数值类型,导致拼接而非加法。
Students frequently lose marks by ignoring the requirements to output prompts and messages exactly as specified. The mark scheme often expects precise wording and formatting. Read the question’s output examples carefully and replicate spaces, newlines and punctuation exactly. Similarly, do not add extra features the question does not request; they can introduce unplanned bugs.
学生常因忽视题目要求而失分:提示信息和消息必须完全按照指定格式输出。评分标准通常期望精确的措辞和格式。仔细阅读题目给出的输出示例,精确复制空格、换行和标点。同样,不要添加题目未要求的额外功能;它们可能引入计划外的错误。
Poor time management is a major risk. Do not spend 90 minutes perfecting Task 2 and leave virtually no time for Task 3 evaluation. Allocate roughly: 25 min for Task 1 (design), 60 min for Task 2 (coding), 25 min for Task 3 (testing/evaluation), and keep 10 min as a buffer for saving files and reviewing.
时间管理不善是一个主要风险。不要花费 90 分钟完善任务二,却几乎没有时间完成任务三的评价。大致分配如下:25 分钟给任务一(设计),60 分钟给任务二(编码),25 分钟给任务三(测试/评价),留出 10 分钟作为缓冲用于保存文件和检查。
11. Exam-Day Strategies and Practical Tips | 考试当天的策略与实用建议
Back up your work every 5– o you can revert if a change introduces a critical bug. At the start of the exam, configure your IDE to show line numbers and enable syntax highlighting; this reduces visual strain and speeds up debugging.
每 5 到 10 分钟备份一次工作。保存代码的多个版本(如 task2_v1.py, task2_v2.py),这样当某次改动引入严重错误时可以回滚。考试开始时,配置 IDE 显示行号并启用语法高亮;这能减少视觉疲劳并加速调试。
Read the entire question paper before typing anything. Highlight key requirements, constraints and special cases. Underline the exact inputs, outputs and file names requested. Many mistakes happen simply because a student misread the expected output format or forgot a validation rule.
在敲击键盘之前,通读整份试卷。高亮关键需求、约束和特殊情况。在试卷上标记出要求的精确输入、输出和文件名。许多错误仅仅是因为学生误读了期望的输出格式或忘记了一条验证规则。
If you get stuck on a tricky algorithm, do not freeze. Place a comment like “needs refining” and move to a different part of the solution. You can earn marks for other sections and return with a clearer mind. Review your design; often the answer is already sketched in your pseudocode.
如果卡在一个棘手的算法上,不要僵住。添加像“需要细化”这样的注释,转而处理解法中的其他部分。你可以在其他小节得分,然后带着更清晰的思路回来解决。回顾你的设计;答案往往已经在你伪代码的草稿中浮现了。
Finally, in your evaluation, be honest about what works and what does not. Recognising limitations—such as the program not handling all edge cases or not being efficient for very large files—and proposing achievable improvements demonstrates critical thinking and can lift you into the top mark bands.
最后,在评价中诚实地说明哪些有效、哪些无效。承认局限性——例如程序未处理所有边缘情况或对于非常大的文件效率不高——并提出可行的改进方案,能够展示批判性思维,并可能将你推入最高分数段。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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