State what should be written in place of the labels L1, L2, and L3 in the algorithm below to successfully identify and output the weather station with the highest recorded temperature.
SUBROUTINE analyzeTemperatures(type, totalStations)
readings ← [['Station A', 'Station B', 'Station C', 'Station D', 'Station E'],
['14.2', '-3.5', '22.1', '18.9', '-1.2']]
idx ← 0
maxTemp ← -100.0
IF type = 'MAXIMUM' THEN
FOR j ← 0 TO totalStations - 1
temp ← STRING_TO_FLOAT(readings[L1][j])
IF temp > maxTemp THEN
maxTemp ← temp
idx ← L2
ENDIF
ENDFOR
ELSE
OUTPUT 'Mode not supported'
ENDIF
IF maxTemp ≠ -100.0 THEN
OUTPUT 'Highest temperature at ', readings[0][idx], ' is ', readings[1][idx], '°C'
ENDIF
ENDSUBROUTINE
OUTPUT 'Enter MAXIMUM or MINIMUM: '
userMode ← USERINPUT
analyzeTemperatures(L3, 5)
L1
L2
L3
131 exam-style questions on AQA GCSE Computer Science Structured programming and subroutines (procedures and functions). Each one has a worked solution and a mark scheme showing where the marks go.