logo

AQA A-Level Computer Science practice

Explain two benefits of using local variables in subroutines. Your answer should refer to accessibility and the effect on program development or reliability.

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

At a glance

Question

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

Explain two benefits of using local variables in subroutines. Your answer should refer to accessibility and the effect on program development or reliability.

Answer and explanation

Concise answer

A local variable is accessible only within the subroutine that declares it, so other parts of the program cannot accidentally change it.

Why this is correct

Full credit should identify restricted accessibility and limited existence, then link these properties to good practice such as clearer subroutines, reduced accidental changes, or improved reliability.

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

No flashcards are published for this page yet.

Related practice questions