CodeHS Unit 9 Test - Animations and Games

CodeHS Unit 9 Test - Animations and Games

8th - 10th Grade

20 Qs

quiz-placeholder

Similar activities

Computer Science - X

Computer Science - X

8th - 10th Grade

20 Qs

4.6.4 Logic Gates

4.6.4 Logic Gates

10th Grade - Professional Development

15 Qs

quiz januari

quiz januari

8th Grade

20 Qs

Google

Google

7th - 12th Grade

20 Qs

M1_Final_Quiz1_2017

M1_Final_Quiz1_2017

7th - 8th Grade

20 Qs

แบบทดสอบบทที่ 1 เรื่อง ข้อมูลมีคุณค่า ม.5

แบบทดสอบบทที่ 1 เรื่อง ข้อมูลมีคุณค่า ม.5

10th Grade

20 Qs

Logika & Pemrograman (ID)

Logika & Pemrograman (ID)

10th Grade - Professional Development

20 Qs

L4 Homework

L4 Homework

8th Grade

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

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?