String handling operations in a programming language

EasyMedium
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
Question 26
Easy

An algorithm is shown in the pseudocode below.

1  instruments ← ['Spectrograph', 'Imager', 'Coronagraph']
2  primary ← 'Photometer'
3  secondary ← 'Polarimeter'
4  result ← SUBSTRING(5, 5, primary)
5  OUTPUT result

Note: SUBSTRING(start,length,string)\text{SUBSTRING}(\text{start}, \text{length}, \text{string})SUBSTRING(start,length,string) returns a substring of length length\text{length}length starting at the 0-based index start\text{start}start.

What is the output of line 5?

’meter’\text{'meter'}’meter’

’omete’\text{'omete'}’omete’

’photo’\text{'photo'}’photo’

’tometer’\text{'tometer'}’tometer’

String handling operations in a programming language Questions

  1. GCSE
  2. /Computer Science
  3. /String handling operations in a programming language