wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming with Karel

Total questions: 22

Worksheet time: 12mins

Name
Class
Date
1.

What is the start function?

a)

A function that starts.

b)

It is the main body of a program, where all other functions are called up.

c)

It is the start of a racing program.

d)

It is another function like all others that can be written with any definition you want.

2.

Which function will allow Karel to spin in circle?

a)
b)
c)
d)
3.

How familiar are you with computer programming?

a)

I really don't understand programming?

b)

I feel a little more comfortable since our class?

c)

I feel like I already know most things about programming?

d)

I am a pro and ready to go work for Google, Apple or some other major programming company.

4.

What is a reason we use functions?

a)

Break down our program into smaller parts.

b)

Because it is more complex.

c)

It looks cool and helps the fight against martians!

d)

Functions are basically Algebra and programmers like Algebra.

5.

What is another reason we use functions?

a)

To help make things in programming more complex.

b)

to repeat code more frequently and make it harder to others to know what we are doing.

c)

To avoid repeating code and make it more readable.

d)

To help fight against galactic invaders and keep cats out of Karel's world.

6.

How much wood could a woodchuck chuck, if a wood chuck could program on a computer?

a)

No way to know.

b)

Programming will not help a woodchuck.

c)

Woodchuck's should learn programming.

d)

Basically the same amount as always.

7.

What is top down design?

a)

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.

b)

Top down design is a way that you can create designs on a computer to put on a web page

c)

Top down design is a way of designing your programs starting with the individual commands first

d)

Top down design is a way to use loops and classes to decompose the problem

8.

In the following code snippet, how many times is the turnRight function called and how many times is it defined?

a)

Called 1 time, defined 1 time

b)

Called 1 time, defined 3 times

c)

Called 3 times, defined 1 time

d)

Called 3 times, defined 3 times

9.

What is a code comment?

a)

A way to teach Karel a new word

b)

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

c)

A message to your teacher in code

d)

A place to write whatever you want in your code

10.

What commands does SuperKarel know that regular Karel does not?

a)

turnLeft() and jump()

b)

turnRight() and jump()

c)

turnAround() and turnRight()

d)

turnAround() and jump()

11.

Which of the following is the correct for loop syntax to make Karel turn left 4 times?

a)

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

turnLeft();

}

b)

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

turnLeft();

}

c)

for var i = 0; i < 4; i++

turnLeft();

d)

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

turnLeft();

}

12.

What is the best way for Karel to move 10 times?

a)

move();

move();

move();

move();

move();

move();

move();

move();

move();

move();

b)

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

move();

}

c)

move(10);

d)

move10();

13.

Which "if" statement is correctly written?

a)

for (condition) {

//code in here

}

b)

if (condition) {

//code in here

}

c)

if (var i = 0; i < count; i++) {

//code in here

}

d)

if false {

//code in here

}

14.

Why do we use if statements in JavaScript?

a)

To break out of some block of code

b)

To do something only if a condition is true

c)

To do something while a condition is true

d)

To repeat something for a fixed number of times

15.

Why do we use while loops in JavaScript?

a)

To break out of some block of code

b)

To do something if a condition is true

c)

To repeat some code while a condition is true

d)

To repeat something for a fixed number of times

16.

Which general while loop definition is written correctly?

a)

while (x is true) {

//code

}

b)

if (i < 5) {

//code

}

c)

while (var i = 0; i < count; i++) {

//code

}

d)

while (condition) {

//code

}

17.

Which of the following are control structures:

  1. "if" function
  2. "if/else" function
  3. "while" function
  4. "for" function
a)
  1. only
b)
  1. and 2.
c)
  1. 3. and 4.
d)

all of them

18.

What do we use control structures for in JavaScript?

a)

Control the flow of the program; how the commands execute.

b)

Start our JavaScript program

c)

Store information for later

d)

Teach Karel new commands

19.

You need to write a program where Karel will take a ball if there is a ball present, otherwise Karel should put down a ball.

Which control structure do you need to use?

a)

For Loop

b)

While Loop

c)

If Statement

d)

If/Else Statement

e)

None of these

20.

You need to write a program that has Karel move 6 times and then put a ball.

Which control structure do you need to use?

a)

Foor Loop

b)

While Loop

c)

If Statement

d)

If/Else Statement

e)

None of these

21.

You need to write a program that has Karel take all the tennis balls where Karel is standing if there are any there.

Karel should end up with no tennis balls on that spot.

Which control structure do you need to use?

a)

For Loop

b)

While Loop

c)

If Statement

d)

If/Else Statement

e)

None of these

22.

You need to write a program that has Karel move if the front is clear, but if it isn’t clear, Karel will do nothing.

Which control structure do you need to use?

a)

For Loop

b)

While Loop

c)

If Statement

d)

If/Else Statement

e)

None of these