What is the difference between a constant and a variable
8.CT.a.1 - Super Mario

Passage
•
Computers
•
8th Grade
•
Hard
Vincent Maxwell
Used 5+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A variable can change, a constant stays the same
A constant can change, a variable stays the same
There are no differences
A constant constantly updates, a variable varies its updates
Answer explanation
In modern javascript a constant is declared like so:
const SPEED = 5;
Whereas a variable is declared like so:
var speed = 5;
A constant cannot be changed, but a variable can. In our older version of javascript the "const" declaration doesn't exist yet, so we put a comment before the variable to define them as constants for ourselves.
2.
FILL IN THE BLANK QUESTION
1 min • 1 pt
The GROUND_LEVEL constant defines where sprites in the game world stand on the _-____ .
Answer explanation
The ground level defines the y-coordinate we use to set where sprites cannot fall through
3.
FILL IN THE BLANK QUESTION
1 min • 1 pt
The MAX_JUMP_HEIGHT defines how high a sprite can jump on the _-_________ .
Answer explanation
The max height jump defines the y-coordinate we use to set where sprites cannot jump higher than
4.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
How do you declare a variable in Javascript? Select all correct choices
var intAge = 13;
var age(5);
var strName = 'Thomas';
name = "Thomas";
Answer explanation
Strings (text) can be defined like so:
var name = "Thomas";
Integers (number) can be defined like so:
var age = 5;
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
SPEED is used to determine mario's sprite object's ...
.velocityX
.velocityY
.velocityX and .velocityY
the .x and .y coordinates
Answer explanation
In our code, we use SPEED to set the .velocityX and .velocityY of the Mario object. Whether Mario jumps or runs, he's always using the same speed declared by the constant.
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Why will this code not run?
there has to be a number in the variable
there are supposed to be no spaces in the variable label
there are no caps in variables
Answer explanation
A variable label must never have a space!
7.
FILL IN THE BLANK QUESTION
45 sec • 1 pt
A _______ is a piece of memory that can contain a data value.
Create a free account and access millions of resources
Similar Resources on Quizizz
35 questions
Scratch coding

Quiz
•
7th - 9th Grade
39 questions
Quizizz: Lesson 3.7 If-Then-Else - Student Activity Guide

Quiz
•
6th - 8th Grade
30 questions
Python Basics

Quiz
•
8th - 10th Grade
40 questions
LatSos Kelas 8

Quiz
•
8th Grade
39 questions
fcms comp sci exam material

Quiz
•
8th Grade
37 questions
Banana Tales - CodeMonkey

Quiz
•
6th - 8th Grade
30 questions
Intro to Python

Quiz
•
8th Grade
34 questions
CSD II - Unit 3 Chapter1 2021

Quiz
•
8th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
10 questions
Identify Slope and y-intercept (from equation)

Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
15 questions
Volume Prisms, Cylinders, Cones & Spheres

Quiz
•
8th Grade
26 questions
June 19th

Quiz
•
4th - 9th Grade
25 questions
Argumentative Writing & Informational Text Vocabulary Review

Quiz
•
8th Grade
18 questions
Informational Text Vocabulary

Quiz
•
7th - 8th Grade