Font size
WorksheetsCodeHS 5.1
Total questions: 15
Worksheet time: 20mins
Which of these is a valid Karel command?
move()
move;
move();
forward();
If Karel is facing North and the code
runs, which direction is Karel facing now
North
South
East
West
How many times should Karel turn left to turn right?
1
2
3
4
What can be used to have Karel turn right?
A loop
A function
if/else statments
comments
Which function will tell Karel how to spin in a circle two times?
How many times should the start function be defined in a problem?
0
1
2
3
Explain how a while loop is different from a for loop.
What is the proper way to write a for loop to repeat something 10 times?
for( i = 0; i < 10; i ++)
for( var i = 0; i < 10; i ++)
for i = 0 to 10 step 1
for (var i = 0; i < 10; i--)
Which code segment answers the questions: If Karel is facing South then turn to face East otherwise face North?
How do you write multi-line comments in JavScript?
//
/*
*/
#
"""
"""
Why do we use functions in Karel programs?
all of the given answers
break down our program into smaller parts
make code more readable
avoid repeating code
How many times is the function CollectCoins called in this code? (Click the picture to see bigger)
1
3
4
5
What does it mean to define a function?
Why does a programmer indent their code? Check all that apply.
it helps show the structure of the code
it is a rule of the JavaScript code language
the program in CodeHS does it automatically
easier for people to understand
You should use a (a) control structure to code Karel to put down 300 tennis balls.
