Animation and Games JavaScript

Animation and Games JavaScript

9th - 12th Grade

24 Qs

quiz-placeholder

Similar activities

AP CSP Unit 7: Parameters, Returns, and Libraries

AP CSP Unit 7: Parameters, Returns, and Libraries

9th - 12th Grade

26 Qs

Variables

Variables

5th - 12th Grade

20 Qs

CSD: Unit 3, Ch 1 Test

CSD: Unit 3, Ch 1 Test

8th - 11th Grade

20 Qs

Chapter 2: Input and Output Devices

Chapter 2: Input and Output Devices

9th - 11th Grade

20 Qs

Karel the Dog Review

Karel the Dog Review

9th - 12th Grade

20 Qs

Python_2R

Python_2R

KG - Professional Development

20 Qs

U3 Review CSD

U3 Review CSD

9th - 12th Grade

19 Qs

OCR GCSE Computer Science Subroutines

OCR GCSE Computer Science Subroutines

12th Grade

19 Qs

Animation and Games JavaScript

Animation and Games JavaScript

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Thomas Martinez

FREE Resource

24 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

What does this program do?

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

2.

MULTIPLE CHOICE QUESTION

2 mins • 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

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

The following 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

2 mins • 1 pt

Media Image

We extend our draw function to include:


How many times will the ball be moved before the animation stops?

20

40

2

25

5.

MULTIPLE CHOICE QUESTION

2 mins • 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

I, II, and III

II and IV

I and III, and IV

I, II, III, and IV

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Which function has better reusability?

Media Image
Media Image

7.

MULTIPLE CHOICE QUESTION

2 mins • 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.

10

20

5

100

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?