Question bank › GCSE Computer Science › Programming

String handling & conversions

Answer on paper first, then reveal the mark scheme one mark at a time.

1Grade 6–75 marks

The string handling functions below are used in AQA pseudocode. Characters in a string are indexed from 0.

word ← 'COMPUTER'
a ← LEN(word)
b ← SUBSTRING(2, 4, word)
c ← POSITION(word, 'U')
d ← CHAR_TO_CODE('C')
e ← CODE_TO_CHAR(d + 2)

State the value stored in each variable after the code has run. Assume the character set used is ASCII, where 'A' is 65. [5]

Still losing marks on this topic?

Book a free introductory session and we'll find exactly which step is costing you.

Book a free intro