Elena is writing a program to log hourly atmospheric pressure readings (in hectopascals) from a digital barometer over a 12-hour storm monitoring period.
The pseudocode for her initial implementation is:
20 x = 0 WHILE x < 12 SET x TO x + 1 RECEIVE y FROM BAROMETER OUTPUT x, y ENDWHILE
In some development environments, a program written on a single line like this can be parsed and executed.
Discuss the suitability of this code for human developers and explain how it could be improved to ensure it is readable and maintainable.
51 exam-style questions on Edexcel GCSE Computer Science Develop code, 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. Each one has a worked solution and a mark scheme showing where the marks go.