Code HS Answers: Lessons 1-20 100% pass
Newest
Which is a valid Karel command?
II! II! II! II! II!
move; II!
MOVE
move(); II!
move() - Correct Answers move(); II! II! II! II! II!
II! What is a street in a Karel world? - Correct Answers Row
II! II! II! II! II! II! II! II! II! II! II! II!
II! What is an avenue in a Karel world? - Correct Answers Column
II! II! II! II! II! II! II! II! II! II! II! II!
II! If Karel starts at Street 1 and Avenue 3 facing East, what street (row) and avenue (column) will Karel be on
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! after this code runs?
II! II! II!
move();
move();
move();
turnLeft();
move(); - Correct Answers Street 2 Avenue 6
II! II! II! II! II! II! II! II!
II! If Karel is facing North and the code
II! II! II! II! II! II! II! II!
turnLeft();
turnLeft();
runs; which direction is Karel facing now? - Correct Answers South
II! II! II! II! II! II! II! II! II! II! II!
II! How many times should Karel turn left in order to turn right? - Correct Answers 3
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
,II! What can be used to teach Karel to turn right? - Correct Answers functions
II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! Which function will teach Karel how to spin in a circle one time?
II! II! II! II! II! II! II! II! II! II! II! II!
function spin() { II! II!
II! turnRight();
}
function spin() { II! II!
II! turnLeft();
II! turnLeft();
II! turnLeft();
II! turnLeft();
}
function spin() { II! II!
II! turnLeft();
II! turnLeft();
}
function spin() { II! II!
II! move();
II! move();
II! move();
II! move();
} - Correct Answers function spin() {
II! II! II! II! II! II! II!
II! turnLeft();
II! turnLeft();
II! turnLeft();
II! turnLeft();
}
, II! How many times should the start function be defined in a program? - Correct Answers 1
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! How many times should the start function be called in a program? - Correct Answers 0
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! Why do we use functions in programming? - Correct Answers Break down our program into smaller parts
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
Avoid repeating code II! II!
Make our program more readable
II! II! II! II!
II! What is a top down design? - Correct Answers Top down design is a way of designing your program by
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! starting with the biggest problem and breaking it down into smaller and smaller pieces that are easier to
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! solve.
II! What is a code comment - Correct Answers A way to give notes to the reader to explain what your code is
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! doing
II! What commands does SuperKarel know that regular Karel does not? - Correct Answers turnAround();
II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! and turnRight();
II!
II! Why should a programmer indent their code? - Correct Answers Helps show the structure of the code
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
Easier for other people to understand
II! II! II! II! II!
Indenting is a key part of good programming styleII! II! II! II! II! II! II! II!
II! 2.4.7 Building a Shelter Code - Correct Answers turnLeft();
II! II! II! II! II! II! II! II! II!
makeSide();
function turnRight(){ II!
II! turnLeft();
II! turnLeft();
II! turnLeft();
II!
}
turnRight();
, makeSide();
function makeSide(){
II!
II! move();
II! putBall();
II! move();
II! putBall();
II! move();
II! putBall();
}
goHome();
function goHome(){
II!
II! turnRight();
II! move();
II! putBall();
II! move();
II! putBall();
II! move();
II! putBall();
II! turnLeft();
II! turnLeft();
II! turnLeft();
II! move();
II! move();
II! move();
II! turnLeft();
II! turnLeft();
}
Newest
Which is a valid Karel command?
II! II! II! II! II!
move; II!
MOVE
move(); II!
move() - Correct Answers move(); II! II! II! II! II!
II! What is a street in a Karel world? - Correct Answers Row
II! II! II! II! II! II! II! II! II! II! II! II!
II! What is an avenue in a Karel world? - Correct Answers Column
II! II! II! II! II! II! II! II! II! II! II! II!
II! If Karel starts at Street 1 and Avenue 3 facing East, what street (row) and avenue (column) will Karel be on
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! after this code runs?
II! II! II!
move();
move();
move();
turnLeft();
move(); - Correct Answers Street 2 Avenue 6
II! II! II! II! II! II! II! II!
II! If Karel is facing North and the code
II! II! II! II! II! II! II! II!
turnLeft();
turnLeft();
runs; which direction is Karel facing now? - Correct Answers South
II! II! II! II! II! II! II! II! II! II! II!
II! How many times should Karel turn left in order to turn right? - Correct Answers 3
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
,II! What can be used to teach Karel to turn right? - Correct Answers functions
II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! Which function will teach Karel how to spin in a circle one time?
II! II! II! II! II! II! II! II! II! II! II! II!
function spin() { II! II!
II! turnRight();
}
function spin() { II! II!
II! turnLeft();
II! turnLeft();
II! turnLeft();
II! turnLeft();
}
function spin() { II! II!
II! turnLeft();
II! turnLeft();
}
function spin() { II! II!
II! move();
II! move();
II! move();
II! move();
} - Correct Answers function spin() {
II! II! II! II! II! II! II!
II! turnLeft();
II! turnLeft();
II! turnLeft();
II! turnLeft();
}
, II! How many times should the start function be defined in a program? - Correct Answers 1
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! How many times should the start function be called in a program? - Correct Answers 0
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! Why do we use functions in programming? - Correct Answers Break down our program into smaller parts
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
Avoid repeating code II! II!
Make our program more readable
II! II! II! II!
II! What is a top down design? - Correct Answers Top down design is a way of designing your program by
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! starting with the biggest problem and breaking it down into smaller and smaller pieces that are easier to
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! solve.
II! What is a code comment - Correct Answers A way to give notes to the reader to explain what your code is
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! doing
II! What commands does SuperKarel know that regular Karel does not? - Correct Answers turnAround();
II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! and turnRight();
II!
II! Why should a programmer indent their code? - Correct Answers Helps show the structure of the code
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
Easier for other people to understand
II! II! II! II! II!
Indenting is a key part of good programming styleII! II! II! II! II! II! II! II!
II! 2.4.7 Building a Shelter Code - Correct Answers turnLeft();
II! II! II! II! II! II! II! II! II!
makeSide();
function turnRight(){ II!
II! turnLeft();
II! turnLeft();
II! turnLeft();
II!
}
turnRight();
, makeSide();
function makeSide(){
II!
II! move();
II! putBall();
II! move();
II! putBall();
II! move();
II! putBall();
}
goHome();
function goHome(){
II!
II! turnRight();
II! move();
II! putBall();
II! move();
II! putBall();
II! move();
II! putBall();
II! turnLeft();
II! turnLeft();
II! turnLeft();
II! move();
II! move();
II! move();
II! turnLeft();
II! turnLeft();
}