Which is an example of declaring a variable?
[Hall] Unit 8 JS Variables & Animation

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Jocelyn Hall
Used 4+ times
FREE Resource
13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
var sunSize = 10;
sunSize = 10;
sunSize;
sunSize += 10;
Answer explanation
In JavaScript we use
var
to declare a variable.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where is our PDE file do we declare a varaible?
outside of the draw function
inside of the draw function
Answer explanation
For now, all variables we use in the PDE file should be declared OUTSIDE of the draw function.
Sample Syntax~~
setup function
DECLARE VARIABLES
draw function
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is an example of incrementing a variable?
var sunSize = 10;
sunSize = 10;
sunSize += 10;
Answer explanation
To increment a variable means to increase it by the same amount at each change.
For example, your code may increment a scoring variable by +2 each time a goal is made.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is the shortcut version of
toothSize = toothSize + 8;
toothSize += 8;
toothSize + 8;
toothSize = 8;
toothSize ++ 8;
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is the shortcut version of
toothSize = toothSize - 3;
toothSize -= 3;
toothSize - 3;
toothSize = 3;
toothSize -- 3;
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where is our PDE file do we increment a variable?
outside of the draw function
inside of the draw function
Answer explanation
For now, all variables we increment in the PDE file should be declared INSIDE of the draw function.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many time do we need to declare each variable?
example
var xPosition;
Once
Every time we use the variable
Create a free account and access millions of resources
Similar Resources on Quizizz
12 questions
Intro to Small Basic

Quiz
•
7th - 9th Grade
11 questions
JS Certification

Quiz
•
12th Grade
15 questions
Blockly Assessment

Quiz
•
6th - 9th Grade
17 questions
Python - Quiz

Quiz
•
9th - 11th Grade
17 questions
LA2.C2: Statements, Properties, and Operations

Quiz
•
9th Grade
15 questions
AP CSP Unit 4

Quiz
•
10th - 12th Grade
16 questions
Arithmetic Types Declare Initialize Relation Logical Ops

Quiz
•
9th Grade - University
15 questions
Java Script Quiz

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University