Signed up recently but had issues with the confirmation email?
Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.
Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.
Global and local variables.
2.2.1 Programming Techniques
Practise exam questionsProgramming Techniques — Note 3 of 6
Candidates need to understand the difference, benefits and drawbacks of global and local variables. Candidates must be able to recognise where each is used and its impact on a program, for example the amount of memory used, and change a program from one to the other.
A variable's scope is the part of the program where it can be used. Global variables can be used anywhere; local variables only exist inside the subroutine where they are declared. Choosing the correct scope makes programs more reliable and easier to maintain.
A variable whose scope is the whole program, so it can be accessed anywhere, including inside subroutines. OCR pseudocode declares it with the global keyword, e.g. global userid = 123.
Declared inside a subroutine; it only exists while the subroutine runs and can only be accessed within it.
Past exam questions
Ready to test yourself?
Practise 2.2.1 questions