WorksheetsCS: Quiz/Test 2.1-2.10
Total questions: 15
Worksheet time: 8mins
What is a street in a Karel world?
A column
A row
An array
An avenue
What is an avenue in a Karel world?
A row
A street
A column
An avenue
How many times should Karel turn left in order to turn right?
1 time
3 times
2 times
4 times
If Karel is facing North and the code
turnLeft();
turnLeft();
runs, which direction is Karel facing now?
North
South
East
West
What can be used to teach Karel to turn right?
Variables
Dog treats
Functions
Karel already knows.
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();
}
How many times should the start function be defined in a program?
0
1
2
As much as you'd like
How many times should you call the start function when writing your program?
0
1
2
Never
Why do we use functions in programming?
Break down our program into smaller parts
Avoid repeating code
Make our program more readable
Makes it easier for ourselves and others to understand
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 to use loops and classes to decompose the problem
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
What is a code comment?
A message to your teacher in code
A way to teach Karel a new word
A place to write whatever you want in your code
A way to give notes to the reader to explain what your code is doing
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();
for (var i = 0; i < 10; i++) {
move();
}
move(10);
move10();
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 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
