wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Karel Adventures 1 Review

Total questions: 34

Worksheet time: 22mins

Name
Class
Date
1.

_________________ is giving the computer a set of commands.

a)

Debugging

b)

Programming

c)

the Internet

d)

Karel

2.

Which Karel command is written correctly?

a)

move;

b)

Putball()

c)

turnLeft();

d)

move(;

3.

Which line contains the bug?

a)

1 and 5

b)

2 only

c)

3 only

d)

5 only

4.

How many times should Karel turn left in order to turn right?

a)

1

b)

2

c)

3

d)

4

5.

Which code below will put Karel in the position shown in picture?

a)

move(); Move(); turnLeft(); move();

b)

move; move(); turnLeft; move();

c)

move(); move(); TurnLeft(); Move();

d)

move(); move(); turnLeft(); move();

6.

Which code will put Karel in the position shown in second world?

a)

putBall(); putBall(); move(); move();

b)

move(); putBall(); move(); putBall();

c)

putBall(); move(); putBall(); move();

d)

move(); putBall(); putBall(); move();

7.

The code in the picture will move Karel in a square.

a)

True

b)

False

8.

This code:

putBall();

move();

putBall();

put 2 balls in the same place and then move one place?

a)

True

b)

False

9.

Which command is written incorrectly?

a)

putBall();

b)

putball();

c)

turnLeft();

d)

takeBall();

10.

What does this error mean?

a)

missing ( ) { }

b)

missing ;

c)

missing (

d)

there is no function in the program

11.

Why do we use if/else statements in JavaScript?

a)

To repeat something for a fixed number of times

b)

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

c)

To break out of some block of code

d)

To repeat something while a condition is true

12.

Which conditional statement should be used for this situation:


If there is a ball, Karel should take it. Then Karel should move forward.

a)

if

b)

if

if

c)

if

else

d)

none of these

13.

Which conditional statement should be used for this situation:


If there is a ball present, Karel should take it. If the front is clear, Karel should move forward.

a)

if

b)

if

if

c)

if

else

d)

none of these

14.

Which conditional statement should be used for this situation:


If there is a ball present, Karel should take it. If there is no ball present, Karel should turn around.

a)

if

b)

if

if

c)

if

else

d)

none of these

15.

Which is the correct code?

a)

turnLeft();

putBall();

move():

putBall();

move();

b)

turnLeft();

putBall()

move()

putBall:

move();

c)

turnLeft();

putBall();

move():

putall:

move();

16.
Say you want to write a program to have Karel to pick up all of the tennis balls in a location, but you don’t know how many tennis balls there are. Which control structure would you use?
a)
An if/else statement
b)
A while loop
c)
A for loop
d)
An if statement
17.
Statements that only run under certain conditions or situations.
a)
Conditionals
b)
Run Statements
c)
Digital Statements
d)
Command
18.
Finding and fixing errors in programs
a)
Tech support
b)
Decompose
c)
Debugging
d)
Fixing
19.
If Karel is facing North and the code
turnLeft(); 
turnLeft();
turnLeft();
runs; which direction is Karel facing now?
a)
North
b)
East
c)
South
d)
West
20.
If Karel is facing North and the code
turnLeft();
turnLeft();
runs, which direction is Karel facing now?
a)
North
b)
South
c)
East
d)
West
21.

Why would we use a while loop instead of a for loop?

a)

we don't know how many times we want to run the loop

b)

we know how many times we want to run the loop

c)

It's a structure that is more efficient to code and execute

d)

it's best practicies

22.

What does this code do?

a)

Puts down a row of balls

b)

Puts down a column of balls

c)

Puts down balls in a line up to the wall

d)

Removes all of the balls along a path to the wall

23.

What is the best code to replace condition in this code to make Karel move to the wall in front of her?

a)

facingNorth()

b)

frontIsClear()

c)

noWallsPresent()

d)

facingWall()

e)

true

24.

Which of the following is not a valid condition to go in an 'if' statement for Karel?

a)

ballsPresent()

b)

frontIsClear()

c)

leftIsBlocked()

d)

turnLeft()

25.

What condition should be used in this while loop for Karel to pick up all the tennis balls at the current location?

while (________) {

takeBall();

}

a)

noBallsPresent()

b)

ballsPresent()

c)

frontIsClear()

d)

takeBall()

26.

What does this code do?

a)

When Karel is not facing a wall, puts a ball down and moves Karel forward

b)

When Karel is facing a wall, no ball is placed and Karel doesn't move

c)

When Karel is facing a wall, a ball is placed and Karel doesn't move

d)

Trick question: this code won't run

27.

Which of the following is used to create a loop that executes as long as a condition is true?

a)

for

b)

do-while

c)

while

d)

loop

28.

What is the significance of the "if-else" statement in block coding?

a)

It allows the code to choose between two paths based on a condition

b)

It repeats a block of code multiple times

c)

It defines a function

d)

It creates a variable

29.

If Karel is facing South and the code:

turnLeft();

turnLeft();

runs; which direction is Karel facing now?

a)

North

b)

South

c)

East

d)

West

30.

What is a code comment?

a)

A way to teach Karel a new word

b)

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

c)

A message to your teacher in code

d)

A place to write whatever you want in your code

31.

What does this error mean?

a)

missing ( ) { }

b)

missing ;

c)

missing (

d)

there is no function in the program

32.

What is a code comment?

a)

A way to teach Karel a new word

b)

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

c)

A message to your teacher in code

d)

A place to write whatever you want in your code

33.

If Karel is facing South and the code:

turnLeft();

turnLeft();

runs; which direction is Karel facing now?

a)

North

b)

South

c)

East

d)

West

34.

Look at the starting and ending worlds and the code that was written to accomplish it. Which of the following programs also accomplishes the same task.

a)

b)

c)

d)