NEW
Font size
WorksheetsKarel Adventures 1 Review
Total questions: 34
Worksheet time: 22mins
_________________ is giving the computer a set of commands.
Debugging
Programming
the Internet
Karel
Which Karel command is written correctly?
move;
Putball()
turnLeft();
move(;
Which line contains the bug?
1 and 5
2 only
3 only
5 only
How many times should Karel turn left in order to turn right?
1
2
3
4
Which code below will put Karel in the position shown in picture?
move(); Move(); turnLeft(); move();
move; move(); turnLeft; move();
move(); move(); TurnLeft(); Move();
move(); move(); turnLeft(); move();
Which code will put Karel in the position shown in second world?
putBall(); putBall(); move(); move();
move(); putBall(); move(); putBall();
putBall(); move(); putBall(); move();
move(); putBall(); putBall(); move();
The code in the picture will move Karel in a square.
True
False
This code:
putBall();
move();
putBall();
put 2 balls in the same place and then move one place?
True
False
Which command is written incorrectly?
putBall();
putball();
turnLeft();
takeBall();
What does this error mean?
missing ( ) { }
missing ;
missing (
there is no function in the program
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
Which conditional statement should be used for this situation:
If there is a ball, Karel should take it. Then Karel should move forward.
if
if
if
if
else
none of these
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.
if
if
if
if
else
none of these
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.
if
if
if
if
else
none of these
Which is the correct code?
turnLeft();
putBall();
move():
putBall();
move();
turnLeft();
putBall()
move()
putBall:
move();
turnLeft();
putBall();
move():
putall:
move();
turnLeft();
turnLeft();
turnLeft();
runs; which direction is Karel facing now? turnLeft();
turnLeft();
runs, which direction is Karel facing now?
Why would we use a while loop instead of a for loop?
we don't know how many times we want to run the loop
we know how many times we want to run the loop
It's a structure that is more efficient to code and execute
it's best practicies
What does this code do?
Puts down a row of balls
Puts down a column of balls
Puts down balls in a line up to the wall
Removes all of the balls along a path to the wall
What is the best code to replace condition in this code to make Karel move to the wall in front of her?
facingNorth()
frontIsClear()
noWallsPresent()
facingWall()
true
Which of the following is not a valid condition to go in an 'if' statement for Karel?
ballsPresent()
frontIsClear()
leftIsBlocked()
turnLeft()
What condition should be used in this while loop for Karel to pick up all the tennis balls at the current location?
while (________) {
takeBall();
}
noBallsPresent()
ballsPresent()
frontIsClear()
takeBall()
What does this code do?
When Karel is not facing a wall, puts a ball down and moves Karel forward
When Karel is facing a wall, no ball is placed and Karel doesn't move
When Karel is facing a wall, a ball is placed and Karel doesn't move
Trick question: this code won't run
Which of the following is used to create a loop that executes as long as a condition is true?
for
do-while
while
loop
What is the significance of the "if-else" statement in block coding?
It allows the code to choose between two paths based on a condition
It repeats a block of code multiple times
It defines a function
It creates a variable
If Karel is facing South and the code:
turnLeft();
turnLeft();
runs; which direction is Karel facing now?
North
South
East
West
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
What does this error mean?
missing ( ) { }
missing ;
missing (
there is no function in the program
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
If Karel is facing South and the code:
turnLeft();
turnLeft();
runs; which direction is Karel facing now?
North
South
East
West
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.
