WorksheetsKarel Quiz
Total questions: 22
Worksheet time: 47mins
Which command is written correctly?
Move
move
Move();
move();
Which command is written incorrectly?
putBall();
putball();
turnLeft();
takeBall();
This code:
putBall();
move();
putBall();
put 2 balls in the same place and then move one place?
True
False
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
Why do we use functions in programming?
Break down our program into smaller parts
Avoid repeating code
Make our program more readable
All of the above
Define a Function
means to teach the computer a new command and explain what it should do when receiving that command.
an instruction you can give to Karel
used to mark what code needs to perform in a certain block
actually gives the command, so the computer will run the code for that function.
Call a Function
actually gives the command, so the computer will run the code for that function.
an instruction you can give to Karel
means to teach the computer a new command and explain what it should do when receiving that command.
used to mark what code needs to perform in a certain block
Top Down Design
a method for breaking our program down into smaller parts.
The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
A message in your code that explains what is going on.
This is the function that is called when you click run.
How many times does Karel move with this loop?
9
0
10
1
The code in the picture will move Karel in a square.
True
False
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();
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 would correctly have Karel move to and pick up BOTH balls?
Which code shows Karel getting to the ball and taking it?
Which code correctly has Karel jump both Hurdles and reach the end of the 1st street to the right?
What would be the resulting world if the following code ran in the starting world shown?
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 if that condition is false
To break out of some block of code
To repeat something while a condition is true
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
You need to write a program that has Karel move 6 times and then put a ball.
Which control structure do you need to use?
FOR loop
WHILE loop
IF statement
IF/ELSE statement
None of the above
You need to write a program that has Karel take all the tennis balls where Karel is standing.
Karel should end up with no tennis balls on that spot.
Which control structure do you need to use?
FOR loop
WHILE loop
IF statement
IF/ELSE statement
None of the above
You need to write a program that has Karel move if the front is clear, but if it isn’t clear, Karel will do nothing.
Which control structure do you need to use?
FOR loop
WHILE loop
IF statement
IF/ELSE statement
None of the above
You need to write a program where Karel will take a ball if there is a ball present, otherwise Karel should put down a ball.
Which control structure do you need to use?
FOR loop
WHILE loop
IF statement
IF/ELSE statement
None of the above
