Game Lab - Variables

Quiz
•
Computers
•
7th - 12th Grade
•
Hard
Tim Helland
Used 27+ times
FREE Resource
6 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Choose all of the blocks that create a new variable in Game Lab.
Answer explanation
To create a variable, the JavaScript keyword var should be present. Otherwise, you are attempting to use an existing variable.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Every block in Game Lab represents a piece of Javascript code.
True
False
Answer explanation
When you use blocks in Game Lab, you are really dragging around pieces of Javascript code.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the final value of x when this program runs?
3
4
0
Nothing. An error will occur.
Answer explanation
This is valid code. x will have the same value as y because of the last code block.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What should be changed about this code?
Nothing. It is the best way to write this code.
The blocks should be reordered.
The variable names don't match.
You must always set a variable to equal a number.
Answer explanation
The blocks should be reordered so that x is defined before it is used in other blocks.
A variable should be declared with the var keyword before it is used elsewhere.
Note: Due to how Javascript works, this code will run either way. But, it is best practice to reorder these blocks.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which statement is most accurate about this code?
The program will not run.
The ellipse is very wide.
The ellipse is at the right.
The ellipse is at the left
The ellipse is very tall.
Answer explanation
The correct code should have been to put width in the 3rd spot.
But, it will still work as is. The "x" value of the ellipse will be 400. This moves it to the far right.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is wrong with this code?
x has been declared more than once using var.
Values should not exceed 100.
Nothing. It is perfectly fine as is.
Answer explanation
The correct code should look like this.
You should only declare the same variable one time using the var keyword.
Note: This won't show an error in Game Lab, but it isn't correct.
Similar Resources on Wayground
11 questions
Programming - Variables/Animation

Quiz
•
6th - 8th Grade
10 questions
AP CSA Unit 1 & 2 Review

Quiz
•
9th - 12th Grade
10 questions
HTML Coding

Quiz
•
9th - 11th Grade
10 questions
Python Basics

Quiz
•
12th Grade - University
10 questions
Y8 Flow Diagrams

Quiz
•
8th Grade
10 questions
Programming Languages

Quiz
•
11th Grade
10 questions
CSS Borders

Quiz
•
8th Grade
10 questions
SNAP-Quiz 1

Quiz
•
9th Grade
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
18 questions
Company Logos

Quiz
•
6th - 8th 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
25 questions
How to Email a Teacher- https://youtu.be/NioeNhfpVfI

Quiz
•
6th - 8th Grade
20 questions
Computer Hardware

Quiz
•
6th - 8th Grade