GCSE (9-1) Computer Science
Mark Scheme
J277/02: Unit 2.2 Arrays & Data Structures
Question Answer Marks Guidance
1 Gap 1: scores.length (or 5) (1)
Gap 2: i (1)
2
Must reference the loop variable i correctly for the index.
2 Any two from:
  • Code is more efficient/shorter (can use loops) (1).
  • Easier to search/sort data (1).
  • Easier to maintain/add more students without adding new variables (1).
2
Do not accept "It's faster" without explanation. Focus on coding efficiency.
3a "Dan" 1
3b "Caz" 1
3c Result: Error / Out of bounds (1)
Reason: The array has rows 0 and 1. Row 2 is outside the valid range (1).
2
Ghost Topic: Precision on (Row, Col) order and "Out of bounds" terminology is critical.
4a It updates Column 1 (Price) instead of Column 2 (Quantity). 1
Column mapping is a low-scoring area in reports.
4b stock[0, 2] = stock[0, 2] - 1 1
5 - (0, 1): val 2 | total -2
- (1, 0): val 3 | total 1
- (1, 1): val 4 | total 5
- Final Output: 5
4
1 mark for each correct step update of total.
6a Stored as Integers/Numbers which do not keep leading zeros. 1
Data Type Trap: Phone numbers must be Strings.
6b contacts = ["07...", "07...", ...] 1
Quotes must be added to preserve formatting.
7 id = input("Enter Student ID")
total = 0
for i = 0 to 2
  total = total + marks[id, i]
next i
avg = total / 3
print(avg)
6
BP4: Fixed Row (id), Changing Col (i) is required.
8 found = False
for r = 0 to 3
  for c = 0 to 2
    if marks[r, c] == 100 then
      found = True: print("Found")
    endif
  next c
next r
if found == False then print("Not Found")
6
Logic Error: Printing "Not Found" inside the loop is an immediate fail.