Game Lab - Variables

Game Lab - Variables

7th - 12th Grade

6 Qs

quiz-placeholder

Similar activities

Code Evaluation

Code Evaluation

9th - 11th Grade

10 Qs

Python Selection

Python Selection

8th - 9th Grade

10 Qs

Python variables and Data types

Python variables and Data types

10th - 12th Grade

10 Qs

String Methods

String Methods

9th - 12th Grade

10 Qs

Kodu Lesson Quiz

Kodu Lesson Quiz

7th - 9th Grade

11 Qs

Code.org Unit 5 Vocab Quiz 1

Code.org Unit 5 Vocab Quiz 1

9th - 12th Grade

10 Qs

Lesson 3 - Using Variables

Lesson 3 - Using Variables

8th Grade

11 Qs

Intro to JavaScript

Intro to JavaScript

9th Grade

11 Qs

Game Lab - Variables

Game Lab - Variables

Assessment

Quiz

Computers

7th - 12th Grade

Hard

Created by

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.

Media Image
Media Image
Media Image
Media Image

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

Media Image

What is the final value of x when this program runs?

3

4

0

Nothing. An error will occur.

Answer explanation

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Media Image

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.