JavaScript Animates
Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Thomas Martinez
FREE Resource
Enhance your content in a minute
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
We extend our draw function to include the code above. How many times will the ball be moved before the animation stops?
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
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); }
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); }
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.
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
13 questions
Five Nights At Freddy's: Security Breach Quiz
Quiz
•
KG - Professional Dev...
15 questions
Layers, IP, MAC Addressing and Packets
Quiz
•
2nd - 9th Grade
10 questions
Avaliação 1T - JavaScript
Quiz
•
9th - 12th Grade
12 questions
Spreadsheet
Quiz
•
5th - 11th Grade
10 questions
Microsoft MDM & Apps
Quiz
•
10th Grade
12 questions
Інформатика 5 Нуш Пайтон 2 Графіка п 25-26
Quiz
•
12th Grade
15 questions
4.6.4 Logic Gates
Quiz
•
10th Grade - Professi...
10 questions
câu hỏi anime
Quiz
•
1st Grade - University
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
