An embedded system monitoring a satellite payload uses the following variables to store status data:
satellite_id ← 'Astro-X9_Telemetry'
sensor_type ← 'Infrared_Payload'
orbit_class ← 'Low_Earth_Orbit'
status_code ← 'Error:0x4F_Degraded'
The system uses two standard string handling functions:
POSITION(string, character) returns the 0-based index of the first occurrence of character in string.SUBSTRING(start, length, string) returns the substring of length length starting at the 0-based position start.The variable y is assigned a value using the following statement:
y ← SUBSTRING(POSITION(status_code, '0'), 6, status_code)
What is the value of y?
’0x4F_’\texttt{'0x4F\_'}’0x4F_’
’x4F_De’\texttt{'x4F\_De'}’x4F_De’
’0x4F_D’\texttt{'0x4F\_D'}’0x4F_D’
’or:0x4’\texttt{'or:0x4'}’or:0x4’
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.