No student devices needed. Know more
30 questions
move();
move();
move();
turnLeft();
move();
turnLeft();
turnLeft();
turnLeft();
runs; which direction is Karel facing now? 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
How many times should the start function be defined in a program?
0
1
2
However many you like
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 can be used to teach Karel to turnaround?
Functions
Variables
Dog treats
Karel can already turn right
What makes the following command an invalid Karel command?
turnleft();
It should end in a colon rather than a semicolon
The l should be a capital L
It should start with a capital T
This command is correct
What is the proper format for a single line comment in Karel?
This is a comment.
// This is a comment.
/* This is a comment. */
//This is a comment.//
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 to get Karel to pick up all the tennis balls on the current location?
noBallsPresent()
ballsPresent()
frontIsClear()
takeBall()
How can we teach Karel new commands?
For loop
While loop
Define a new function
The start function
What is the purpose of using a for loop in code?
To do something if a condition is true
To do something while a condition is true
To repeat something a fixed number of times
To make programs run faster
In the above code, what would be a good Postcondition to write?
Karel is on a spot with a tennis ball facing north
Karel ends one spot above a tennis ball facing East.
Karel is on the same position but on top of a ball.
Karel is facing East.
How many total times will Karel move in this program?
1
5
6
7
Explore all questions with a free account