Loops
Functions
Conditional statements
Coding style
Vocab
Wild card
Computers
100

What function do you never call?

start() function
100

How do you write a single line comment?

// You use two forward slashes


move(); // You can also comment on the same line as code

100

What is a computer?

A computer performs calculations by executing specific instructions to solve a problem.

100

What can be used to teach Karel to turn right?

A. Functions      B. Variables      C. Loops      D. Dog treats

A. Functions

100

What are the 3 most general things all computers do?

Input info, process info, output info (also store information)

200

Using the following loop, how many times will Karel move?

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

        move();

}

8 times

200

What are the two things you must do with a function when coding?

1. Define the function

2. Call the function

200

How many values can a condition return? What are those values?

2 values: true and false

200

How do you write a multi-line comment?

/* Use a forward slash and star to begin

And a star and forward slash to end */

200

What is syntax?

The rules for how you must type code for a certain programming language.

200

What are the rules for naming a function?

- Name should start with a letter

- No spaces

- Name should describe what the function does

200

How do computers store information?

Binary, 1's and 0's

300

What is the proper syntax in Karel for a FOR loop?

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

\* Type loop body here *\

}

300

What is the proper syntax in Karel for defining a function called eatHamSandwich?

function eatHamSandwich() {

/* Type function body here */

}

300

Write a "real life" example of a conditional statement.

Mr. Porter's example: "If students study hard, then they will do well on the quiz and grow 1" taller."

Insert your example here!

300

What is top-down design?

Start with a big problem and break it into smaller parts.

300

What is pseudocode?

Short phrases that explain what you want your code to do. You can write this before you write the real code.

300

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

How many times should the start function be called in the program?

Defined: 1 time

Called: 0 times

300

What is the difference between hardware and software?

Hardware - physical components

Software - programs that tell the hardware what to do

400

What are three ways to write increase the variable i by 1?

i++ (this is the only way you can type it in Karel)

i + 1

i += 1

400

What is the proper syntax in Karel for calling a function named devourBagel?

devourBagel();

400

What is the proper syntax in Karel for an if...then statement?

if ( condition() ) {

/* run this code if true */

}

400

What are pre-conditions and post-conditions when it comes to functions?

Mr. Porter will say the answer out loud.

400

What is nesting?

Nesting is writing a loop inside a loop or a conditional inside a conditional or calling a function inside another function.

400

Karel is facing North. After the following code, which direction is Karel facing?

turnLeft();

turnLeft();

move();

South

400

What is a digital footprint?

The trail you leave when you use the internet.
500

What are the three arguments that go into a FOR loop?

1. Define the counter variable (var i = 0;)

2. Specify the end condition (i < 10;)

3. Specify how the loop iterates (i++)

500

What are three reasons to use functions?

1. Break down the program into smaller parts

2. Avoid repeated code (save time and lines of code)

3. Make the program more readable

500

What is the proper syntax in Karel for an if...then...else statement?

if ( condition() ) {

/* run this code if true */

} else {

/* run this code if false */

}

500

Why should you use comments?

To give an explanation/reminder of what your code does. A good approach is to write what you were thinking when you wrote the code.

500

What is camel case?

A good way to write function names:

makePancakes   finishBellwork   stayOnTask   askQuestions   workTogether   beKindToEachOther

500

Define a function with correct syntax to teach Karel to turn around and move forward 1 space. Name the function using camel case.

function turnAroundAndMove() {

     turnLeft();

     turnLeft();

     move();

}

500

What are 3 ways that computers impact your everyday life?

Example answers:

Enables long-distance communication

Provides access to information

Speeds up everyday tasks

M
e
n
u