CodeHS 4.9 Local Variables and Scope

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Aaron Pavao
Used 21+ times
FREE Resource
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the term for a variable declared inside a method?
method variable
local variable
global variable
private variable
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where does a variable that is declared inside a method exist?
only in that method
only in the class the method is in
only in methods that declare the variable
as long as the program is running
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is scope?
the part of a program where the variable exists
a minty mouthwash
a device used to aim a projectile
a device in a submarine that is used to view the surface
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What characters denote a block?
< >
[ ]
{ }
( )
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where does a variable exist?
from when it's declared to the end of the block it's in
from when it's declared to the end of the method it's in
from when it's declared to the end of the class it's in
from when it's declared to the end of the program it's in
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When two variables have the same name, which one does Java use?
the one with the most specific scope
the one with the most general scope
the one with the most private scope
the one with the lowest memory address
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens when a variable is given the same name as a variable with a different scope?
shadowing
RepeatedNamingException
syntax error
infinite loop
Similar Resources on Wayground
12 questions
Topic 1 C++ Programming

Quiz
•
12th Grade
10 questions
MODULE 3 Q4 ASSESSMENT

Quiz
•
10th Grade
10 questions
Programming and Variables

Quiz
•
11th Grade
9 questions
Understanding Swift Variables and Scope

Quiz
•
9th Grade
8 questions
Introduction to Computer Science

Quiz
•
12th Grade
11 questions
CMU CS Academy Unit 2 Part 6 Global Variables and Scope

Quiz
•
9th Grade
8 questions
Variables in Python Quiz

Quiz
•
11th Grade
10 questions
H466 - Global and Local Variables

Quiz
•
12th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th 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
20 questions
Analog vs Digital

Quiz
•
9th - 12th Grade
10 questions
CTEA Computer Vocab Terms #1

Quiz
•
12th Grade
10 questions
Exploring Cybersecurity Techniques and Threats

Interactive video
•
6th - 10th Grade
10 questions
Understanding the Internet and Data Transmission

Interactive video
•
7th - 12th Grade