
135. OCR A Level (H046-H446) SLR23 – 2.2 Global & local variable
Authored by James Cole
Computers
11th Grade

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What should you have a solid understanding of before watching the videos?
None of the above
History of computer science
Advanced algorithmic strategies
Basic programming concepts and different data types
Answer explanation
Before watching the videos, you should have a solid understanding of basic programming concepts and different data types.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main purpose of the videos?
To focus solely on theoretical knowledge
To teach programming concepts from scratch
To provide entertainment
To reinforce and consolidate understanding of programming techniques
Answer explanation
The main purpose of the videos is to reinforce and consolidate understanding of programming techniques.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How does one become a good programmer according to the text?
By programming little and often
By only studying theory
By watching videos exclusively
By avoiding programming practice
Answer explanation
To become a good programmer, one should program little and often according to the text.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the scope of a local variable?
At the top of a program
None of the above
Only within a subroutine
Throughout the program
Answer explanation
Local variables have scope only within the subroutine where they are declared, not throughout the entire program.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where is a global variable typically declared?
Within a specific function only
At the top of a program
At the bottom of a program
Inside a subroutine
Answer explanation
A global variable is typically declared at the top of a program to make it accessible throughout the entire program, not limited to a specific function or subroutine.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens to local variables when the subroutine ends?
They are converted into constants
They remain active throughout the program
They are destroyed
They become global variables
Answer explanation
Local variables are destroyed when the subroutine ends, they do not remain active or become global variables.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can two variables share the same name if they have different scopes?
Only if they are constants
No
Only in specific programming languages
Yes
Answer explanation
Yes, two variables can share the same name if they have different scopes in programming.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?