logo

Pearson Edexcel GCSE (9-1) Computer Science practice

A programmer is developing a game that frequently needs to check if a specific number is divisible by 7. Describe the value of creating a subprogram for this check, rather than writing the division logic directly each time it is needed. [3 marks]

Try the question first, then check the answer and practise the same topic again.

At a glance

Question

Type

exam_style

Style

Topic

Decomposition and abstraction

Exam-style question

Try this first

A programmer is developing a game that frequently needs to check if a specific number is divisible by 7. Describe the value of creating a subprogram for this check, rather than writing the division logic directly each time it is needed. [3 marks].

Answer and explanation

Concise answer

Creating a subprogram for the 'is divisible by 7' check offers significant value.

Why this is correct

1 mark for explaining code reusability by writing the logic once. 1 mark for explaining improved readability through a named function/encapsulation. 1 mark for explaining easier maintenance or debugging because changes/fixes are in one place.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

Flashcard 1 of 6

Press Space to flip, arrows to move

Related practice questions