AQA A-Level Computer Science AS Paper 1, June 2025: Question 12
3 marks · Medium difficulty · Short Answer
Describe one similarity and two differences between the FOR loop used for direction 'E' and direction 'W' in subroutine CheckPath.
Practise this questionQuestion
Question text
12 This question refers to the subroutine CheckPath.
Describe one similarity and two differences between the FOR loop used when the
direction is "E" and the FOR loop used when the direction is "W".
In your response you should refer only to the FOR loops, not the code inside the
FOR loop structures.
[3 marks]
Mark scheme
Show the mark scheme
12 3 marks for AO2 (analyse) 3
Similarity (Max 1):
Both loops count up;
Both loops have a step of one;
Both loops use Column;
Differences (Max 2):
The loop for "E" starts at the start column whereas the loop for "W" starts at the end
column;
The loop for "E" ends at the end column whereas the loop for "W" ends at the start
column;
The start and end values for the loops are reversed (between E and W);
I. Exact start/end points as long as reference is made to the start and end columns
How to answer it
Subroutine CheckPath: Comparing FOR Loop Header Structures
Core Focus: AO2 (Application and Code Analysis). Specifically, reading skeleton code to compare how definite iteration ( FOR loops) is structured across symmetrical routines.
- Loop syntax & parameters: Identifying loop counter variables, step sizes, and direction of increment.
- Boundary evaluation: Comparing initialisation (start value) and termination conditions (stop/end value).
- Attention to negative constraints: Strictly isolating the control header/loop structure from the statements executed inside the loop body.
Question 12
Analysis of FOR loops for East ("E") vs West ("W") traversal [3 Marks]
✅ Mark Scheme Criteria
Similarity (Max 1 mark):
- Both loops count up / increment.
- Both loops have a step value of 1 (+1).
- Both loops use the same control/counter variable ( Column ).
Differences (Max 2 marks):
- The loop for "E" starts at the start column, whereas the loop for "W" starts at the end column.
- The loop for "E" ends at the end column, whereas the loop for "W" ends at the start column.
- Alternative 2-mark summary: The start and end boundary values are reversed between "E" and "W" .
🧠 Exam Technique & Strategy
- Obey the negative constraint: The prompt explicitly states: "refer only to the FOR loops, not the code inside the FOR loop structures". Mentioning board checks, cell validation, or return statements scores 0.
- Always present paired comparisons: For a difference, mention both scenarios. Saying "E starts at start column" only earns a mark if you state what "W" does ("...whereas W starts at the end column").
- Inspect standard loop mechanics: A FOR loop signature consists of three core components: Counter variable, Range (start to end), and Step size. Use these three pillars to find your points.
💡 Key Knowledge: Skeleton Code Anatomy
In standard grid-based AQA skeleton programs (like 2D array board games):
- Direction "E" (East): Moves left-to-right across columns.
FOR Column = StartColumn + 1 TO EndColumn - 1 - Direction "W" (West): Checks path between cells. Because arrays are typically indexed positively, rather than counting down with a step of -1 , the loop is often written to count upwards from the lower index to the higher index:
FOR Column = EndColumn + 1 TO StartColumn - 1 - Note: Examiners accept general references to "start column" and "end column" even if offsets (like +1 or -1) exist.
❌ Common Errors & Pitfalls
- Discussing the loop body: Stating "Both check if the board cell is empty" or "Both set Valid to False". This ignores the explicit instruction and forfeits marks.
- Assuming West counts downwards: Candidates often assume without looking at the skeleton code that West must use STEP -1 . In this codebase, both count upwards in steps of +1!
- Vague comparisons: Writing "They have different start points" without specifying which starts where.
• Similarity: Both FOR loops use the variable Column as the loop counter and count upwards with a step of 1.
• Difference 1: The loop for "E" starts at the start column, whereas the loop for "W" starts at the end column.
• Difference 2: The loop for "E" finishes at the end column, whereas the loop for "W" finishes at the start column.
Topics
4.1 Fundamentals of programming · 4.4 Theory of computation · 4.1.1 Programming · 4.4.1 Abstraction and automation
Question and mark scheme from the AQA A-Level Computer Science examination, AS Paper 1, June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.