Data types and structures

EasyMedium
12345678910
Question 3
Medium

A satellite tracking system catalogues orbital payloads using a standardised telemetry identifier format.

The format of each identifier is structured as follows:

  • The first two characters represent the launch nation (e.g. 'US', 'JP', or 'UK').
  • This is followed by a forward slash (/).
  • The next field is a 4-digit launch year.
  • This is followed by a forward slash (/).
  • The next field is a 5-character payload classification code.
  • This is followed by a forward slash (/).
  • The final field is a 3-digit sequential launch number.

Example valid identifiers:

  • US/2023/COMMS/045
  • JP/2019/METEO/012
  • UK/2025/MILIT/108

Assume a variable named tracking_id stores one of these valid identifiers as a string.

Construct an expression, using string slicing or indexing, to extract the 5-character payload classification code from tracking_id. Assume 0-based indexing is used.

[3]

Data types and structures Questions

  1. GCSE
  2. /Computer Science
  3. /Data types and structures