An automated drone telemetry system tracks real-time flight data. A programmer writes a procedure to adjust the altitude readings of drones operating in a specific high-altitude sector to compensate for atmospheric pressure drift.
The 2D array sys_data stores flight records in the format [droneID, sector, altitude, pressure].
PROCEDURE calAlt()
BEGIN PROCEDURE
FOR n FROM 0 TO LENGTH(sys_data) - 1 DO
IF sys_data[n,1] == "Sector_C" THEN
SET sys_data[n,2] TO sys_data[n,2] * 1.042
END IF
END FOR
END PROCEDURE
State two changes that could be made to this pseudocode to improve its readability or maintainability.
Practise Edexcel GCSE Computer Science Develop code with exam-style questions for GCSE Computer Science. 57 questions covering Decomposition and abstraction to solve problems, Read, write, analyse and refine programs, Converting algorithms into programs, Techniques for readable, maintainable code, Identifying and correcting program errors, and Evaluating program fitness and efficiency, matched to the Edexcel GCSE Computer Science (1CP2) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.