String handling operations in a programming language

EasyMedium
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
Question 31
Easy

An environmental monitoring station processes telemetry packets using pseudocode. The following variables are initialized:

station ← 'KSEA_Seattle'
sensor ← 'Temp_Probe_02'
reading ← '-12.4'

The programmer uses the function SUBSTRING(start, length, string) which extracts a substring starting at the 0-indexed position start with the specified length.

What is the exact value of the variable packet after executing the following statement?

packet ← SUBSTRING(5, 7, station) + SUBSTRING(0, 4, sensor) + reading

'SeattleTemp-12.4'

'Seattle_Temp-12.4'

'SeTemp-12.4'

'Seattle Temp -12.4'

String handling operations in a programming language Questions

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