NEW
Font size
WorksheetsProgramming with Karel the Dog 2
Total questions: 13
Worksheet time: 7mins
How many times should the start function be defined in a program?
0
1
2
How ever many you like
How many times should you call the start function in a program?
0
1
2
However many times you like
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 that you can create designs on a computer to put on a web page
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 of designing your programs starting with the individual commands first
Top down design is a way to use loops and classes to decompose the problem
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
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
}
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 (var i = 0; i < count; 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
}
