21 questions
Which function will teach Karel how to spin in a circle one time?
Function spin(){
turnRight();
}
Function spin () {
turnLeft();
turnLeft();
turnLeft();
turnLeft();
}
Function spin () {
turnLeft();
turnLeft();
}
Function spin () {
move();
move();
move();
move();
}
Which of these is a valid Karel command?
move;
MOVE
move();
move()
What is a street in a Karel world?
a row
a column
a single point
Karel's position
What is an avenue in Karel world?
A row
a column
a single point
Karel's position
If Karel starts at street 1 and avenue 3 facing East, what street (row) and avenue (column) will Karel be on after this code runs?
Street 1 and Avenue 3
Street 4 and Avenue 4
Street 2 and Avenue 6
Street 6 and Avenue 2
If Karel is facing North and the code
turnLeft();
turnLeft();
North
South
East
West
Which general if statement definition is written correctly?
for(condition) {
//code
}
if(condition) {
//code
}
if(var i=0; I < count; I++) {
//code
}
if false {
//code
}
How many times should the star function be defined in a program?
0
1
2
however many you like
How many times should the start function be called in a program?
0
1
2
however many times you like
How many times should Karel turn left in order to turn right?
1
2
3
4
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
What does an if/else statement look like in JavaScript
if (condition) {
//code
}
for (van i = 0; i < county I++) {
//code
}
if (condition) {
//code
}
if (condition) {
//code
}
if (condition) {
//code
} else {
//code
}
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
Which general while loop definition is written correctly?
while (x is true) {
//code
}
if (I<5) {
//code
}
while (var i = 0 i < count; i ++) {
//code
}
while (condition) {
//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
What is top down design?
top down design is a way of designing your program by starting with the biggest problem and breaking it down into smaller and smaller pieces that are easier to solve.
top down design is a way that you can create designs on a computer to put on a web page
top down design is a way of designing your programs starting with the individual commands first
top down design is a way to use loops and classes to decompose the program
What can be used to teach Karel to turn right?
functions
variables
dog treats
Karel can already turn right
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 commands does SuperKarel know that regular Karel does not?
turnLeft() and jump()
turnRight() and jump()
turnAround and turnRight()
turnAround and jump()
What is the best way for Karel to move 10 times?
move();
move();
move();
move();
move();
move();
move();
move();
move();
move();
for (var i = 0; i <10; I++) {
move();
}
move(10);
move10();
Why do we use if statements in JavaScript?
to break out of some block of code
to do something only if a condition is true
to do something while a condition is true
to repeat something for a fixed number of times