Variable Scope
Quiz
•
Computers
•
9th Grade
•
Hard
Vernon Leigh
Used 7+ times
FREE Resource
Enhance your content
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the scope of a global variable?
The entire program
The sub-program where it has been declared
Only within the function where it has been declared
Only within the class where it has been declared
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where is the value of a global variable accessible?
Only within the function where it has been declared
Only within the class where it has been declared
Throughout the entire program
Only within the sub-program where it has been declared
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the impact of errors in code on global variables?
No impact
The value of the global variable is lost
The value of the global variable can be accidentally changed
The global variable becomes inaccessible
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why can global variables be a major problem in real commercial programs?
They consume excessive system resources
They can cause errors in code
There may be hundreds or thousands of variables in use
They are difficult to declare and use
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the scope of a local variable?
The entire program
The sub-program where it has been declared
Only within the function where it has been declared
Only within the class where it has been declared
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where are the values of local variables held?
In the main memory
In the cache memory
In the hard disk
In the RAM
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens to a local variable after the execution of its sub-program?
It is retained in RAM
It is lost
It becomes a global variable
It is moved to the cache memory
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
15 questions
Data Types
Quiz
•
7th - 9th Grade
10 questions
Functions
Quiz
•
8th Grade - University
10 questions
WJEC 1.7 Software Engineering
Quiz
•
9th - 10th Grade
12 questions
HIGHER Python Subroutines Quiz
Quiz
•
9th Grade
11 questions
Static/NonStatic
Quiz
•
9th - 12th Grade
10 questions
Programming - Arrays
Quiz
•
2nd - 12th Grade
10 questions
Programming - Variables & Constants
Quiz
•
4th - 12th Grade
10 questions
Understanding Variable Scope in Swift
Quiz
•
9th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
30 questions
Computer Terminology Exercise #1 ( Fill Ins)
Quiz
•
9th Grade
15 questions
MLA Formatting
Quiz
•
9th Grade
20 questions
Typing Practice
Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro
Lesson
•
5th - 9th Grade
20 questions
Google Sheets Quiz
Quiz
•
9th Grade