In computer programming, constant values are often defined at the top of a program using uppercase identifiers.
An example of this is shown on line 2 of the code snippet below:
1 # Automated Greenhouse Climate Control System
2 CRITICAL_TEMP_LIMIT = 38.5 # Critical temperature in degrees Celsius
3
4 current_zone_temp = 24.2 # Current temperature reading from sensor
Explain one reason why a developer should use the named constant CRITICAL_TEMP_LIMIT rather than writing the literal value 38.5 multiple times within the control system's codebase.
44 exam-style questions on Edexcel GCSE Computer Science Data types and structures, covering Primitive and structured data types, Using variables and constants, and Manipulating strings. Each one has a worked solution and a mark scheme showing where the marks go.