String handling operations in a programming language

EasyMedium
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
Question 28
Easy

State the output of line 7 from the algorithm shown in Figure 1.

(Note: Assume string indexing begins at 0 and the substring function takes parameters in the format SUBSTRING(start_index, length, string)).

Figure 1

1  dinosaurs ← ['Stegosaurus', 'Velociraptor']
2  dino1 ← 'Triceratops'
3  dino2 ← 'Diplodocus'
4  OUTPUT dino1
5  OUTPUT LEN(dinosaurs)
6  segment ← SUBSTRING(3, 5, dino1)
7  OUTPUT segment
[1]

String handling operations in a programming language Questions

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