Variable Scope

Quiz
•
Computers
•
9th Grade
•
Hard
Vernon Leigh
Used 7+ times
FREE Resource
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
Similar Resources on Wayground
10 questions
TLE QUIZZIZ 2

Quiz
•
9th - 12th Grade
15 questions
AP Computer Science Principles Unit 4 Review

Quiz
•
9th Grade - University
9 questions
2.1.2 CSE Coding Fundamentals: Dead Reckoning

Quiz
•
9th - 12th Grade
10 questions
Programming - High Level Code & Machine Code

Quiz
•
2nd - 11th Grade
7 questions
CodeHS 4.9 Local Variables and Scope

Quiz
•
9th - 12th Grade
10 questions
PL/SQL

Quiz
•
1st - 10th Grade
15 questions
Programming terminology

Quiz
•
9th Grade
15 questions
Variables Constants Datatypes

Quiz
•
8th - 12th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade