
Variables and ifs in p5.js
Authored by Chris Mera
Computers
8th Grade
Used 7+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 20 pts
What is the correct way to declare a variable to store the number of circles drawn on the canvas in p5.js?
`number circles = 0;`
`var numberOfCircles;`
`int numberOfCircles = 0;`
`let numberOfCircles = 0;`
2.
MULTIPLE CHOICE QUESTION
45 sec • 20 pts
Where should I declare my variables?
In the setup()
Before the setup()
In the loop()
Wherever I want
3.
MULTIPLE CHOICE QUESTION
45 sec • 20 pts
What will be the value of `x` after the following code is executed?
let x = 5; x = x + 10;
5
10
15
20
4.
MULTIPLE SELECT QUESTION
45 sec • 20 pts
Which of the following variable declarations is NOT valid in p5.js?
`let_score;`
`let=2ndPlace;`
`let-$amount;`
`let playerHeight;`
5.
MULTIPLE CHOICE QUESTION
45 sec • 20 pts
What is the value of the variable declared as `let score;` in p5.js?
13
yes
undefined
0
6.
MULTIPLE CHOICE QUESTION
45 sec • 20 pts
Which of the following is the correct way to declare a variable for storing the user's name in p5.js?
`string userName;`
`var userName;`
`let userName = '';`
`userName = " ";`
7.
MULTIPLE CHOICE QUESTION
45 sec • 20 pts
What variable am I missing to describe this object?
let sqX = 20;
let sqW = 20;
let sqH = 20;
let sqColor = "black"
createCanvas
sqY
mouseY
mouseX
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Soal Quiz Sistem Komputer Kelas 8 SMPIT IF Mungkid
Quiz
•
1st Grade - University
12 questions
Categories of Hardware
Quiz
•
7th - 11th Grade
10 questions
Experiencing Chatbots in Real Life
Quiz
•
8th Grade
10 questions
App Development lesson 1
Quiz
•
8th - 9th Grade
7 questions
Python Data Types and Arithmetic Quiz
Quiz
•
8th Grade
10 questions
VEXcode VR Unit 4 Quiz
Quiz
•
6th - 8th Grade
15 questions
Python - тест
Quiz
•
1st - 12th Grade
13 questions
computer components
Quiz
•
8th - 10th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade