JavaScript Animates

JavaScript Animates

9th - 12th Grade

11 Qs

quiz-placeholder

Similar activities

Cyber Security Homework 1

Cyber Security Homework 1

7th - 9th Grade

15 Qs

Adopt me

Adopt me

KG - Professional Development

14 Qs

CALL: Causative Verb

CALL: Causative Verb

10th - 11th Grade

10 Qs

Interfejsy USB i bezprzewodowe oraz urządzenia wskazujące i

Interfejsy USB i bezprzewodowe oraz urządzenia wskazujące i

9th - 12th Grade

10 Qs

Evaluación IV Parcial INTAE

Evaluación IV Parcial INTAE

10th Grade

14 Qs

Quiz1

Quiz1

7th - 9th Grade

10 Qs

LA7.C7: Turtle Graphics

LA7.C7: Turtle Graphics

9th Grade - University

14 Qs

Arrays, 2D Arrays, and ArrayLists

Arrays, 2D Arrays, and ArrayLists

9th - 12th Grade

15 Qs

JavaScript Animates

JavaScript Animates

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Thomas Martinez

FREE Resource

AI

Enhance your content in a minute

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

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which of the following statements are true about ball
I – ball is a local variable 
II – the ball variable in draw is different from the ball variable in start 
III – ball is a global variable 
IV – ball’s scope includes both start and draw

III and IV
I and II
III only
I, II, III, and IV

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Animates a ball by moving it down and to the right once every 20 milliseconds.
Animates a ball by moving it up and to the right once every 20 milliseconds
Animates a ball by moving it down and to the right every 20 seconds
Animates a ball by moving it up and to the right once every 20 seconds

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The given program animates a ball by setting a timer to move the ball across the screen. We want the animation to stop whenever the user clicks the mouse. Which statement would stop the animation in this program?

stopTimer(ball.move(2, 2));
stopTimer(draw);
stopTimer(draw());
stopTimer(draw, 20);

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

We extend our draw function to include the code above. How many times will the ball be moved before the animation stops?

2
20
25
40

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following are techniques that make our code more reusable
I – Using constants instead of magic numbers 
II – Using specific values in our functions rather than using parameters 
III – Writing multiple functions that solve small subproblems rather than one function that solves the entire problem. 
IV – Writing as few lines of code as possible

III, and III
III, III and IV
I and III
II and IV

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function has better reusability?
A: 
function drawCircle(x, y, radius, color) { var circle = new Circle(radius); circle.setPosition(x, y); circle.setColor(color); add(circle); } OR B. 
function drawGreenCircleInCenter(radius) { var circle = new Circle(radius); circle.setPosition(getWidth() / 2, getHeight() / 2); circle.setColor(Color.green); add(circle); }

A
B

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many circles of radius 10 will fit vertically stacked in a window that has height 100? The circles should not overlap, the bottom of one circle should touch the top of the next circle.

100
20
10
5

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?