Question 1
2 marksState two features that a programmer can include in a program to make it easier to maintain.
Model answer
Meaningful identifiers, such as TotalCost instead of X, and comments that explain the purpose of each section of code.
Explanation
A maintainable program is one that another programmer can understand and change easily. The main techniques are meaningful identifiers, relevant comments, procedures and functions, and constants. Each makes the purpose of the code clear without having to work it out line by line.
Mark scheme
-
1 mark
Meaningful identifiers (for variables, constants, arrays, procedures and functions)
max 2; 1 mark per feature
-
1 mark
Comments (explaining the purpose of the code)
-
1 mark
Procedures and functions / splitting the program into subroutines (modules)
-
1 mark
Constants for fixed values
-
1 mark
Consistent indentation / white space