CodeHS Unit 9 Test - Animations and Games
Quiz
•
Computers
•
8th - 10th Grade
•
Hard
Teri Miles
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the following code, when will the function draw be called?
Once, inside of start
Never
Every 20 milliseconds
Every 20 seconds
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this program do?
Draws 1 randomly sized circle at a random place on the canvas.
Draws several randomly sized circles at random places on the canvas by drawing 1 every 50 milliseconds.
Draws 1 randomly colored circle at the center of the canvas.
Draws several randomly colored circles at the center of the canvas by drawing 1 every 50 milliseconds.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why do we want our code to be “reusable”?
To avoid writing similar code multiple times
To avoid solving the same problem over and over again
To save time
All of these are correct.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can we make our code reusable?
Use constants instead of magic numbers
Use parameters in our functions instead of specific values
Write multiple functions that solve small subproblems rather than one function that solves the entire problem.
All of these are correct.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function has better reusability?
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
This is a Circle object on our canvas named ball. Point A is on the far left edge of the circle. How can we calculate the x-coordinate of point A?
ball.getX() - ball.getRadius();
ball.getY() + ball.getRadius();
ball.getX() + ball.getRadius();
ball.getX();
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose we’ve written a function drawCircle that we want to call every time the mouse is clicked. How can we do this?
mouseClickMethod(drawCircle(e));
if(mouseClickMethod){
drawCircle();
}
mouseClickMethod(drawCircle);
mouseClickMethod(drawCircle());
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
20 questions
PRETEST TIK KELAS 8
Quiz
•
8th Grade
20 questions
Unit Test 1 Class 8 Computer
Quiz
•
8th - 9th Grade
20 questions
Software
Quiz
•
10th Grade
20 questions
Q1 M3 PRE-TEST
Quiz
•
10th Grade
20 questions
L4 Homework
Quiz
•
8th Grade
20 questions
Computer Science - X
Quiz
•
8th - 10th Grade
20 questions
Quiz
•
7th - 12th Grade
20 questions
M1_Final_Quiz1_2017
Quiz
•
7th - 8th Grade
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
