A cryptographic algorithm uses two system variables assigned as follows:
prefix ← 'CYPHER_B'
system ← 'TITAN_VI'
A developer writes the following pseudocode to generate a temporary security key:
idx1 ← POSITION(prefix, 'P')
idx2 ← POSITION(prefix, '_')
length ← idx2 - idx1
key ← SUBSTRING(idx1, length, system)
Assume the following standard string operations:
POSITION(str, char) returns the 0-based index of the first occurrence of char in str.SUBSTRING(start, length, str) returns the substring of str starting at index start with length length.← represents the assignment operator.What is the value of key after this pseudocode is executed?
’ITA’\text{'ITA'}’ITA’
’TAN_’\text{'TAN\_'}’TAN_’
’ITAN’\text{'ITAN'}’ITAN’
’AN_V’\text{'AN\_V'}’AN_V’
89 exam-style questions on AQA GCSE Computer Science String handling operations in a programming language. Each one has a worked solution and a mark scheme showing where the marks go.