CodeHS Karel Answer Key

On CodeHS, the students are allowed to practice computer science concepts and programming skills by giving commands to a dog named Karel. In this learning module, Karel the dog needs to complete a variety of tasks by moving around a grid world and placing down and picking up tennis balls using only simple commands.

It is known that Karel the dog learning module actually teaches more advanced concepts using languages such as Java, JavaScript and HTML. After completing the Karel the dog module, the students will be given a series of tasks where they need to answer the questions correctly.

Of course, if the students are able to answer the questions on Karel the dog assignment for lessons 1-20 on CodeHS, they will be able to continue their learning on different module, but still regarding computer science concepts and programming skills

CodeHS Karel Answer Key

Code HS Karel Answers for Lessons 1 – 20

Are you looking for Karel the dog assignments? If so, you don’t have to worry, as this post will show you a series of questions and answers regardless of Karel the Dog module for the lessons 1 – 20 that we got from quizzma.com.

Here are the questions and answer keys:

  1. Which is a valid Karel command?
move;

MOVE

move();

move()

Answer: move();

  1. What is a street in a Karel world?

Answer: Row

  1. What is an avenue in a Karel world?

Answer: Column

  1. 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?
move();

move();

move();

turnLeft();

move();

Answer: Street 2 Avenue 6

  1. If Karel is facing North and the code turnLeft(); turnLeft(); runs; which direction is Karel facing now?

Answer: South

  1. How many times should Karel turn left in order to turn right?

Answer: 3 times

  1. What can be used to teach Karel to turn right?

Answer: functions

  1. 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();

}

Answer:

Function spin() {

turnLeft();

turnLeft();

turnLeft();

turnLeft();

}

  1. How many times should the start function be defined in a program?

Asnwer: 1

  1. Why do we use functions in programming?

Answer:

  • To break down our program into smaller parts
  • To avoid repeating code
  • To make our program more readable
  1. What is a top down design?

Answer:  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.

  1. What is a code comment

Answer: A way to give notes to the reader to explain what your code is doing

  1. What commands does SuperKarel know that regular Karel does not?

Answer: turnAround(); and turnRight();

  1. Why should a programmer indent their code?

Answer:

  • To help show the structure of the code
  • To make it easier for other people to understand
  • Indenting is a key part of good programming style
  1. Karel needs to pick up a pile of tennis balls. Which of the following start functions solves the problem at the highest level of abstraction?

Answer:

function start() {

moveToPile();

takePile();

}

  1. Which answer choice describes the game with the lowest level of abstraction?

Answer: First, Steph Curry flexed his left and right quad muscles at the exact same time,  then he flexed each muscle in his fingers…

  1. Abstraction in Karel

Answer: Abstraction helps us write programs by: When we want to create  something   such as a function/command we need to explain it in detail. Meaning we need to add less abstraction to help us understand the command in a simpler way.

Solved Assignment Problems

2.4.7 Building a Shelter Code

Answer:

turnLeft();

makeSide();

function turnRight(){

turnLeft();

turnLeft();

turnLeft();}

turnRight();

makeSide();function makeSide(){

move();

putBall();

move();

putBall();

move();

putBall();

}goHome();

function goHome(){

turnRight();

move();

putBall();

move();

putBall();

move();

putBall();

turnLeft();

turnLeft();

turnLeft();

move();

move();

move();

turnLeft();

turnLeft();

}

2.5.4: Pancakes with Start

Answer:

function start(){

move();

makePancakes();

move();

move();

makePancakes();

move();

move();

makePancakes();

move();

}

function makePancakes(){

putBall();

putBall();

putBall();

}

2.6.4: The Two Towers

Answer:

function start(){

 

move();

turnLeft();

makeTower();

move();

turnRight();

move();

move();

turnRight();

move();

makeTower();

turnLeft();

turnLeft();

move();

move();

move();

turnRight();

 

}

 

function makeTower(){

putBall();

move();

putBall();

move();

putBall();

}

 

function turnRight(){

turnLeft();

turnLeft();

turnLeft();

 

}

2.6.5: Make a ‘Z’

Answer:

function start(){

putBallsInRow();

makeDiagonal();

move();

turnAround();

putBallsInRow();

}// Puts down four balls in a row

function putBallsInRow(){

move();

putBall();

move();

putBall();

move();

putBall();

move();

putBall();

}function makeDiagonal(){

turnRight();

move();

turnRight();

move();

putBall();turnLeft();

move();

turnRight();

move();

putBall();turnLeft();

move();

turnRight();

move();

}function turnRight(){

turnLeft();

turnLeft();

turnLeft();

}function turnAround(){

turnLeft();

turnLeft();

}

2.7.4: The Two Towers + Comments

Answer:

/*

* Karel is going to make towers

*/function start(){move();

turnLeft();

makeTower();

move();

turnRight();

move();

move();

turnRight();

move();

makeTower();

turnLeft();

turnLeft();

move();

move();

move();

turnRight();

}function makeTower(){

putBall();

move();

putBall();

move();

putBall();

}function turnRight(){

turnLeft();

turnLeft();

turnLeft();}

2.9.4: The Two Towers + SuperKarel

Answer:

function start(){

//Karel will build two towers

move();

turnLeft();

makeTower();

move();

turnRight();

move();

move();

turnRight();

move();

makeTower();

turnLeft();

turnLeft();

move();

move();

move();

turnRight();

}

//This function will be used whenever Karel is supposed to build a tower

function makeTower() {

putBall();

move();

putBall();

move();

putBall();

}

2.10.5: Take ’em All

Answer:

function run(){

move();

for(var i = 0; i < 100; i++){

takeBall();

}

move();

}

function start(){

run();

}

2.5.5: Digging Karel with Start

Answer:

function start(){

move();

buryBall();

move();

buryBall();

move();

buryBall();

}function turnRight() {

turnLeft();

turnLeft();

turnLeft();

}

function buryBall() {

move();

turnRight();

move();

move();

move();

putBall();

turnLeft();

turnLeft();

move();

move();

move();

turnRight();

move();

}

2.10.7: For Loop Square

Answer:

function run(){

for(var i = 0; i < 4; i++){

putBall();

move();

turnLeft();

}

}

function start(){

run();

}

Okay, those are some questions and answers to CodeHS Karel the Dog Learning module. If you want a full of CodeHS Karel Answer keys, you can visit Quizzma.com.

Leave a Reply

Your email address will not be published. Required fields are marked *