JavaScript drawing skills

JavaScript drawing skills

Assessment

Flashcard

Computers

9th - 12th Grade

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

3 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Consider the JavaScript code shown in the picture. If the code runs every 20 milliseconds, what is the effect on the arc that is drawn on the canvas?

Media Image

Back

The arc moves vertically between y = 0 and y = 250.

2.

FLASHCARD QUESTION

Front

Consider the JavaScript code shown in the image. You expect the arc to move left to right on the canvas, but you find that it is moving up and down. How do you fix the code to create the movement effect you want? Options: replace ctx.arc(400, x, 20, Math.PI *2, false); with replace ctx.arc(x, 400, 20, Math.PI *2, false);, replace ctx.arc(400, x, 20, Math.PI *2, false); with replace ctx.arc(x, x, 20, Math.PI *2, false);, Set 'x += dx;' to 'x -= dx;' instead., replace ctx.arc(400, x, 20, Math.PI *2, false); with replace ctx.arc(400, 50, x, Math.PI *2, false);

Media Image

Back

replace ctx.arc(400, x, 20, Math.PI *2, false); with replace ctx.arc(x, 400, 20, Math.PI *2, false);

3.

FLASHCARD QUESTION

Front

Consider the JavaScript code shown in the image. You expect the arc to move, but it does not appear on the canvas. How do you fix the code?

Media Image

Back

Change 'setInterval(draw, 20);' to 'setInterval(drawIt, 20);'

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?