Exclusive Practice Resource

GCSE

Computer Science

Unofficial Practice Paper: J277/02: Computational Thinking, Algorithms and Programming

General Certificate of Secondary Education

Mark Scheme for June 2026 [VERSION A]

This is an unofficial practice resource created exclusively for gcsecomputerscience.co.uk. It is not endorsed by, affiliated with, or approved by Oxford Cambridge and RSA Examinations (OCR).
June 2026 Practice Paper (Section A)
Question Answer / Indicative Content Mark Guidance
1 (a) 1 mark per correct element:
  • True / Yes branch labelled correctly [1]
  • Output "Discount" in correct box [1]
  • False / No branch labelled correctly [1]
  • Output "No Discount" in correct box [1]
4 Labels must be explicit (T/F or Y/N).
1 (b) 1. Abstraction [1]
2. Algorithmic Thinking [1]
3. Decomposition [1]
3
2 (a) 1 mark per point (max 4):
  • Divide the list in half repeatedly... [1]
  • ...until each sublist has 1 element [1]
  • Compare the first element of each sublist [1]
  • Merge the smaller element into a new list [1]
  • Repeat until all sublists are merged into one sorted list [1]
4 Must explain both "divide" and "merge" stages for full marks.
2 (b) (i) The array must be sorted in order. 1 Accept: Alphabetical / numerical order.
2 (b) (ii) 1 mark per point:
  • Binary search halves the search area with each comparison [1]
  • It discards half the list each time [1]
  • Whereas linear search checks every item one by one [1]
  • ...which is much slower for 5,000 items [1]
3 Must compare binary vs linear for full marks.
3 (a)
  • Translates high-level code... -> Both [1]
  • Translates and executes... line-by-line -> Interpreter [1]
  • Produces a final executable file... -> Compiler [1]
  • Stops translating... first error is found -> Interpreter [1]
4
June 2026 Practice Paper (Section A Continued)
Question Answer / Indicative Content Mark Guidance
3 (b) 2 marks per tool (1 for identify, 1 for description). Max 2 tools.
  • Error Diagnostics [1]: Highlights the specific line and reason for a syntax error [1].
  • Breakpoints [1]: Pauses the execution of the program at a specific line so variable values can be checked [1].
  • Variable Watch [1]: Allows the programmer to view the value of a variable changing as the code runs [1].
  • Translator [1]: Converts high-level source code into machine code so it can be executed [1].
4 Do not accept "Debugger" without description of diagnostics.
4 (a) 1 mark for each correctly drawn shape and 1 for overall logic:
  • AND gate combining inputs A and B [1]
  • NOT gate on input C (must include inversion circle) [1]
  • OR gate combining the outputs of the AND and NOT gates [1]
  • Correct output line P from the OR gate [1]
4 Marks awarded solely on geometric shape. NOT gate without a circle scores 0.
4 (b) Truth table completion:
  • (A AND B) column correct: 0,0,0,0,0,0,1,1 [1]
  • (NOT C) column correct: 1,0,1,0,1,0,1,0 [1]
  • Output P correct based on their intermediate columns [2] (or 1 if 1-2 errors)
Correct Output P: 1, 0, 1, 0, 1, 0, 1, 1.
4 Allow follow-through if intermediate columns are wrong but OR logic is correct.
5 (a) SELECT Name, Price [2] (1 for SELECT, 1 for fields)
FROM Products [1]
WHERE Price > 20 [2] (1 for WHERE, 1 for condition)
5 Do not penalise lowercase SQL keywords.
5 (b) Price: Real [1] (because currency requires decimal numbers) [1]
InStock: Boolean [1] (because it only has two states e.g. True/False) [1]
4 Reject 'Float'. Accept 'Float' as BOD if justified well, but strictly Real is expected.
June 2026 Practice Paper (Section B)
Question Answer / Indicative Content Mark Guidance
6 (a) Normal Data: Any value between 2 and 499 (e.g. 150) [1]
Valid Boundary Data: 1 or 500 [1]
Invalid Data: -1, 501, or text (e.g. "fifty") [1]
3 0 is Invalid boundary. Do not accept 0 as Valid Boundary.
6 (b) 1 mark for method, 1 mark for reason (max 4):
  • Indentation [1] to show the structure of the code / where loops/selection end [1]
  • Meaningful variable names [1] so other programmers know what data they hold [1]
  • Comments [1] to explain the logic of complex sections [1]
  • Subprograms [1] to reduce repeated code and make sections easier to test [1]
4 Reject "Makes it easier to read" as TV. Must link method to context.
7 (a) Line number: 02 [1]
Correction: Delete the line / Remove line 02 completely [1]
2 The parameter `current` is already passed to the function, using `input()` overwrites it.
7 (b) 1 mark per bullet:
  • Correct function definition with two parameters (currentStock, maxCapacity) [1]
  • Subtracts currentStock from maxCapacity [1]
  • Uses the return keyword [1]
  • Returns the correct calculated variable [1]

Example:
function calculateOrder(currentStock, maxCapacity)
   needed = maxCapacity - currentStock
   return needed
endfunction
4 Deduct 1 mark if `print()` is used instead of `return`. Do not allow `input()`.
June 2026 Practice Paper (Section B Continued)
Question Answer / Indicative Content Mark Guidance
8 (a) 1 mark per bullet:
  • Takes initial input for code before the loop [1]
  • Correct WHILE loop syntax [1]
  • Condition checking length (e.g. code.length != 5) [1]
  • Outputs an error message inside the loop [1]
  • Takes input again inside the loop [1]
  • Outputs "Code Accepted" after the loop [1]

Example:
code = input("Enter code")
while code.length != 5
   print("Error, must be 5 chars")
   code = input("Enter code")
endwhile
print("Code Accepted")
6 MUST be a WHILE loop. Using IF scores maximum 3 marks (for input, condition, error message).
8 (b) Trace Table:
x: 0, 1, 2, 3 [1]
y: 10, 10, 9, 7 [2] (1 for 9, 1 for 7)
Output: 7 [2] (1 for correct value, 1 for only printing at the end)
5 Outputs during the loop score 0 for the output mark.
9 (a) 1 mark per bullet:
  • Initialises a total variable to 0 [1]
  • Correct FOR loop (or equivalent) for rows [1]
  • Loop ranges from 0 to 49 (or 50 times) [1]
  • Accesses the 2D array [1]
  • Uses the loop counter for the row index [1]
  • Uses index 2 for the column index [1]
  • Accumulates the stock quantity into the total variable [1]
  • Outputs the final total after the loop [1]

Example:
total = 0
for row = 0 to 49
   total = total + inventoryData[row, 2]
next row
print(total)
8 Accept `[row][2]` or `[row, 2]`. Penalise 1-based indexing (e.g. 1 to 50) unless arrays are explicitly declared as 1-based.
9 (b) 1 mark per bullet:
  • Opens the file "urgent.txt" [1]
  • Specifically in write mode (e.g. openWrite) [1]
  • Correct FOR loop syntax [1]
  • Loop ranges from 0 to 19 (or 20 times) [1]
  • Writes data to the file (e.g. myFile.writeLine()) [1]
  • Accesses the criticalItems array correctly [1]
  • Uses the loop counter as the array index [1]
  • Closes the file after the loop [1]

Example:
myFile = openWrite("urgent.txt")
for i = 0 to 19
   myFile.writeLine(criticalItems[i])
next i
myFile.close()
8 Must use array index inside the loop.
TOTAL MARKS: 80