Exam-style question
Try this first
Which statement about the use of subroutines is correct?.
- A.A subroutine can only be written at the point where it is first needed
- B.A subroutine is an unnamed block of code that cannot be called
- C.A subroutine can help reduce duplication by placing instructions in one named block
- D.A subroutine is the same as a hardware device
Model answer
What a good answer should say
- A subroutine can help reduce duplication by placing instructions in one named block
Explanation
Why this works
Instructions that are needed in more than one place can be placed in a named subroutine and called when required, reducing duplicated code.
Common mistake
No common mistake is linked to this question yet.
