Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CS: Quiz/Test 2.1-2.10

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is a street in a Karel world?

a)

A column

b)

A row

c)

An array

d)

An avenue

2.

What is an avenue in a Karel world?

a)

A row

b)

A street

c)

A column

d)

An avenue

3.

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

a)

1 time

b)

3 times

c)

2 times

d)

4 times

4.

If Karel is facing North and the code
turnLeft();

turnLeft();

  • runs, which direction is Karel facing now?

a)

North

b)

South

c)

East

d)

West

5.

What can be used to teach Karel to turn right?

a)

Variables

b)

Dog treats

c)

Functions

d)

Karel already knows.

6.

Which function will teach Karel how to spin in a circle one time?

a)

function spin() {

    turnRight();

}

b)

function spin() {

    turnLeft();

    turnLeft();

    turnLeft();

    turnLeft();

}

c)

function spin() {

    turnLeft();

    turnLeft();

}

d)

function spin() {

    move();

    move();

    move();

    move();

}

7.

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

a)

0

b)

1

c)

2

d)

As much as you'd like

8.

How many times should you call the start function when writing your program?

a)

0

b)

1

c)

2

d)

Never

9.

Why do we use functions in programming?

a)
  • Break down our program into smaller parts

b)
  • Avoid repeating code

c)
  • Make our program more readable

d)

Makes it easier for ourselves and others to understand

10.
  • What is top down design?

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

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

c)
  • 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.

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

11.

What is a code comment?

a)
  • A message to your teacher in code

b)
  • A way to teach Karel a new word

c)
  • A place to write whatever you want in your code

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

12.

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()

13.

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

a)

move();

move();

move();

move();

move();

move();

move();

move();

move();

b)

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

    move();

}

c)
  • move(10);

d)
  • move10();

14.

Which general if statement definition is written correctly?

a)

for(condition) {

    // code

}

b)

if(condition) {

    //code

}

c)

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

    //code

}

d)

if false {

    //code

}

15.

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