CodeHS Unit 9 Test - Animations and Games

CodeHS Unit 9 Test - Animations and Games

8th - 10th Grade

20 Qs

quiz-placeholder

Similar activities

New Scratch

New Scratch

6th - 8th Grade

20 Qs

HTML

HTML

8th - 12th Grade

15 Qs

El Computador

El Computador

5th - 11th Grade

20 Qs

Componentes de una computadora

Componentes de una computadora

6th - 8th Grade

20 Qs

Y10M2A2 - Selection

Y10M2A2 - Selection

6th - 10th Grade

15 Qs

Traffic Light Project Quiz

Traffic Light Project Quiz

9th Grade

17 Qs

EVOLUTION OF COMPUTERS

EVOLUTION OF COMPUTERS

4th - 8th Grade

16 Qs

Networking Quiz

Networking Quiz

8th - 9th Grade

15 Qs

CodeHS Unit 9 Test - Animations and Games

CodeHS Unit 9 Test - Animations and Games

Assessment

Quiz

Computers

8th - 10th Grade

Hard

Created by

Teri Miles

FREE Resource

AI

Enhance your content in a minute

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

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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

Media Image

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?

Media Image
Media Image

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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());

Create a free account and access millions of resources

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?