6
0/8

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.

[8]

Develop code Questions

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.

PreviousNext

Develop code Questions

  1. GCSE
  2. /Computer Science
  3. /Develop code