
Reading Code
Quiz
•
Computers
•
3rd - 12th Grade
•
Practice Problem
•
Hard
Brenda McLachlin
Used 6+ times
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this line of code do?
dist(mouseX, mouseY, 200, 200);
Checks how far the mouse is from the center of the screen
Checks if the mouse is clicking on a round button
Creates a circle with a diameter of 200 on the screen at position mouseX, mouseY
Changes the size of the canvas to 200, 200
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this line of code do?
fill(random(255), random(255), random(255), 50);
Sets the colour of a shape to a random shade of grey
Sets the colour of a shape to a random transparent colour
Sets the colour of a line to white
Sets the colour of a line to a random transparent colour
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this line of code do?
for (var i = 0; i < nums.length; i++) {
Repeats for every number that exists
Loops through all the items in the array nums
Counts from zero to the size of the canvas
Nothing - there's an error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this line of code do?
speed *= -1;
Changes the sign of the variable "speed"
Changes the variable speed to its logical opposite
Decreases the framerate by 1
Decreases the speed of an animation by 1
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this line of code do?
var x = i % 2 === 0;
Stores the remainder of i / 2 in the variable x
Makes x true if i is even and false if i is odd
Calculates half of i and stores it in the variable x
Assigns x the value 2 and i the value 0
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this line of code do?
rect(200, 200, 100, mouseX);
Makes a rectangle that changes width based on the mouse
Makes a rectangle that changes height based on the mouse
Makes a rectangle that follows the mouse
Makes a rectangle that you can only see when the mouse hovers over it
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this line of code do?
Obj.draw = function() {
Reassigns the method "draw" of object "Obj" to be a new method
Creates a function that runs 60 times per second
Creates a new object prototype
Changes the way the reserved function "draw" works
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
7ICT - Algorithms Revision Quiz
Quiz
•
7th Grade
20 questions
Online Platform Block Q
Quiz
•
11th - 12th Grade
15 questions
Chapter 3: Storage devices and media (Part 2):
Quiz
•
10th - 11th Grade
20 questions
City & Guilds Award in Business Processes
Quiz
•
12th Grade
20 questions
ASPEK LEGAL TIK XII
Quiz
•
12th Grade
20 questions
Ulangan Harian 1 kls x 2023
Quiz
•
10th Grade
20 questions
Pengayaan Informatika
Quiz
•
12th Grade
20 questions
Dasar-Dasar Keahlian TJKT
Quiz
•
1st - 3rd Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
