Search Header Logo

Unit 3 Exam | CodeHS

Authored by Alicia Alanis

Other

10th Grade

Used 26+ times

Unit 3 Exam | CodeHS
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

26 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a code comment?

A way to teach Karel a new word

A way to give notes to the reader to explain what your code is doing

A message to your teacher in code

A place to write whatever you want in your code

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why do we use if statements in JavaScript?

To break out of some block of code

To do something only if a condition is true

To do something while a condition is true

To repeat something for a fixed number of times

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why do we use if/else statements in JavaScript?

To repeat something for a fixed number of times

To either do something if a condition is true or do something else

To break out of some block of code

To repeat something while a condition is true

4.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Why do we use while loops in JavaScript?

To break out of some block of code

To do something if a condition is true

To repeat some code while a condition is true

To repeat something for a fixed number of times

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an example of a runtime error?

Karel crashing into a wall

A command missing a semicolon

An if/else statement missing a set of parentheses

A function definition missing a closing curly bracket

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The following program is supposed to put down three tennis balls. Where is the logic error?

function main() {
placeThreeBalls();
}
function placeThreeBalls() {
for (let i = 0; i <= 3; i++) {
putBall();
}
}
main();

line 2

line 3

line 5

line 8

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an example of a syntax error?

Karel tries to pick up a ball, but there is no ball to pick up.

A for loop uses commas instead of semicolons.

When run, the program does not match the result world.

Karel crashes into a wall.

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?