Subroutines, Local and Global Variables (AQA A-Level Computer Science): Flashcards
📚Flashcards
Practise the cards
10 cards from this deck
ShowHide
Practise the cards
10 cards from this deck
Subroutine definition
Subroutine definition
Self-contained code block performing specific tasks
How functions differ from subroutines
How functions differ from subroutines
Functions return a value after performing a task
Parameter vs argument
Parameter vs argument
Parameter=placeholder; argument=actual value passed
Local variable
Local variable
Variable only usable within its specific subroutine
Global variable
Global variable
Variable accessible from anywhere in the program
Key advantage of local variables
Key advantage of local variables
Cannot be accidentally changed from other program parts
Side effect in programming
Side effect in programming
When one subroutine's changes affect another's variables
Event in programming
Event in programming
Something triggering a subroutine during program execution
Purpose of exception handling
Purpose of exception handling
Prevents program crashes by catching and managing errors
Module in programming
Module in programming
Group of related subroutines working together
