Structured Programming and Subroutines (AQA GCSE Computer Science): Quizzes
📚Quizzes
Practise the questions
11 questions from this quiz
ShowHide
Practise the questions
11 questions from this quiz
Where are local variables created and used?
Where are local variables created and used?
Inside a subroutine
What does local scope mean for a variable?
What does local scope mean for a variable?
Only exists in its subroutine
When is a local variable created?
When is a local variable created?
When the subroutine starts
When is a local variable destroyed?
When is a local variable destroyed?
When subroutine finishes
Can the main program access local variables?
Can the main program access local variables?
No, it cannot see them
What error occurs when accessing a local variable outside its subroutine?
What error occurs when accessing a local variable outside its subroutine?
name not defined error
How do local variables help with code organisation?
How do local variables help with code organisation?
Variables only used where needed
How do local variables provide memory efficiency?
How do local variables provide memory efficiency?
Auto-cleaned when subroutine ends
How do local variables enable code reusability?
How do local variables enable code reusability?
Same names in different subroutines
How should you pass data into a subroutine?
How should you pass data into a subroutine?
Use parameters
What does 'scope' refer to in programming?
What does 'scope' refer to in programming?
Where a variable can be accessed
