GCSE (9-1) Computer Science
Mark Scheme
J277/02: Unit 2.3 Maintainability
Question Answer Marks Guidance
1a Allows other programmers to understand the logic/purpose of the code (1) so they can update/fix it without breaking it (1). 2
Do not accept "To help the user read it." Focus: Must mention other programmers or future updates.
1b Indentation / Meaningful Variable Names / Use of Subprograms / Constants 1
Accept any valid technique.
2 hours = float(input(...)) (1)
rate = float(input(...)) (1)
pay = hours * rate (1)
3
Ghost Topic Application: The variables must match the context (Pay/Worker). a, b, c earns 0 marks. num1, num2 earns 1 mark (too generic).
3a Start
End
1
Both print because 10 > 5 and both are indented.
3b End 1
Line 03 is skipped. Line 04 is not indented, so it runs regardless of the IF statement.
3c In A, Line 04 is part of the IF block (dependent on condition) (1).
In B, Line 04 is outside the IF block (runs sequentially/always) (1).
2
Examiner Tip: This distinguishes grade 8/9 students. They must understand that indentation controls flow of execution.
4a def draw_square(): (1)
  # Code for one square indented inside (1)
draw_square() (1)
3
Syntax must be correct (use of def and indentation).
4b You only need to update the code in one place (the function definition) (1). The change automatically applies to every time the function is called (1). 2
Key Concept: "Write once, update everywhere." This is the core of maintainability.
5a If the value of Pi needs to change, the programmer has to find/replace it 50 times (1). High risk of missing one or making a typo (1). 2
This tests the "Risk" aspect of maintenance.
5b PI = 3.14 (1)
area = PI * (radius * radius) (1)
2
Constants are conventionally ALL_CAPS.