Skip to content

Course home

Sign up

Develop code

EasyMediumHard
1234567891011121314151617
Question 14

A viticultural scientist wants to log hourly soil acidity (pHpHpH) levels in a vineyard over a 7-day period (168 hours) to ensure optimal grape-growing conditions.

The pseudocode of an algorithm they have written is shown below:

50 h = 0 WHILE h < 168 SET h TO h + 1 RECEIVE p FROM KEYBOARD IF p < 5.5 THEN OUTPUT h, "ACID" ELSE OUTPUT h, "SAFE" ENDIF ENDWHILE

In some programming languages, if a program is written like this on a single line, it could be translated and executed.

Discuss the suitability of this code for humans and how it could be improved.

[6]
Markscheme

Develop code Questions

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

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.

Question bank