• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 28 pages
Exam (elaborations)

Code Hs Answers: Lessons 1-20

Document preview thumbnail
Preview 3 out of 28 pages

CODE HS ANSWERS: LESSONS 1-20

Content preview

CODE HS ANSWERS: LESSONS 1-20
Which is a valid Karel command?
move;
MOVE
move();
move() - Answers- move();

What is a street in a Karel world? - Answers- Row

What is an avenue in a Karel world? - Answers- Column

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(); - Answers- Street 2 Avenue 6

If Karel is facing North and the code
turnLeft();
turnLeft();
runs; which direction is Karel facing now? - Answers- South

How many times should Karel turn left in order to turn right? - Answers- 3

What can be used to teach Karel to turn right? - Answers- functions

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

How many times should the start function be called in a program? - Answers- 0

Why do we use functions in programming? - Answers- Break down our program into
smaller parts
Avoid repeating code
Make our program more readable

What is a top down design? - Answers- 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.

What is a code comment - Answers- 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? - Answers-
turnAround(); and turnRight();

Why should a programmer indent their code? - Answers- Helps show the structure of
the code
Easier for other people to understand
Indenting is a key part of good programming style

2.4.7 Building a Shelter Code - Answers- 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 - Answers- function start(){
move();
makePancakes();
move();
move();
makePancakes();
move();
move();
makePancakes();
move();
}
function makePancakes(){
putBall();
putBall();
putBall();
}

2.6.4: The Two Towers - Answers- 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();
}

Document information

Uploaded on
October 28, 2024
Number of pages
28
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$13.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
GEEKA
3.8
(376)
Sold
2221
Followers
1450
Items
62698
Last sold
1 day ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions