GCSE (9-1) Computer Science
Mark Scheme
J277/02: String Manipulation & ASCII
Question Answer Marks Guidance
1 (a) D (1)
(65 + 3 = 68, which is 'D')

(b) 2 (1)
(ASCII for 'c' is 2 higher than 'a')

(c) 2 (1)
(The character '2', not the number. ASCII 50 represents the digit '2')
3
Examiner's Note: GHOST TOPIC. Students often panic when they see ASC/CHR. They need to know that characters are stored as integers and can be mathematically manipulated.
2a Comparison is case-sensitive. "start" is not equal to "START". 1
2b if command.upper() == "START":
OR
if command.lower() == "start":
1
Examiner's Note: GHOST TOPIC. Robust programs must handle case. Students often forget .upper() requires ().
3 Row 1: 'R' | "R-" | True
Row 2: 'O' | "R-O-" | True
Row 3: 'B' | "R-O-B-" | True
Row 4: [Empty] | [Empty] | False
Output: R-O-B-
4
1 mark for correct letter extraction.
1 mark for correct concatenation with hyphen.
1 mark for correct loop termination.
1 mark for final output.
4 function getInitials(name)
  first = name.substring(0, 1) (1)
  spacePos = name.index(" ") (1)
  second = name.substring(spacePos + 1, 1) (1)
  combined = first + second (1)
  return combined.upper() (2)
endfunction
6
1 mark for return, 1 mark for upper case handling.
Examiner's Note: GHOST TOPIC. High tariff because it combines substring, indexing, and case conversion.
5 Why: String methods return a new string; they do not change the original variable unless re-assigned (1).
Correction: name = name.upper() (1).
2
A very common error in coding tasks.
6
  • left (or substring(0, 3)) (1)
  • length (1)
  • str (or String) (1)
3
Must cast length (integer) to string before concatenating.
7
  • Comp (1)
  • nce (1)
  • 16 (1)
3
Space counts as a character for length (16).
8 pw = input(...)
while pw.length < 8
  print("Too short")
  pw = input(...)
endwhile
4
Must use .length for comparison.
Must ask for input inside loop to avoid infinite loop.
9
  • True (1)
  • True (1) ("Apple" comes before "Zebra" alphabetically).
  • False (1) ("A" is not equal to "a" - Case sensitivity).
3