Reading Code

Reading Code

3rd - 12th Grade

20 Qs

quiz-placeholder

Similar activities

Examen Diagnostico - Secundaria 2023

Examen Diagnostico - Secundaria 2023

6th - 8th Grade

20 Qs

Ulangan1-DETIC-Informatika

Ulangan1-DETIC-Informatika

10th Grade

20 Qs

IP ADDRESSING AND ITS VERSION

IP ADDRESSING AND ITS VERSION

11th Grade

15 Qs

1RO DE PRIMARIA

1RO DE PRIMARIA

KG - 6th Grade

15 Qs

UNIT 1.2 MEMORY

UNIT 1.2 MEMORY

10th Grade

19 Qs

อินเทอร์เน็ต Fi

อินเทอร์เน็ต Fi

5th Grade

15 Qs

9.1 Homework #3

9.1 Homework #3

9th Grade

20 Qs

After Effect Intoduction

After Effect Intoduction

10th Grade - University

15 Qs

Reading Code

Reading Code

Assessment

Quiz

Computers

3rd - 12th Grade

Practice Problem

Hard

Created by

Brenda McLachlin

Used 6+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?