wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming

Total questions: 33

Worksheet time: 21mins

Name
Class
Date
1.

what is a LOOP function?

a)

something that only happens once

b)

something that gets repeated

2.
What is a condition in Karel programming?
a)
What karel does during the program.
b)
A method that returns a true or false answer. Typically used within a control structure.
c)
The number of times a program loops.
d)
The place in code where the program stops running.
3.
How can we teach Karel new commands?
a)
Define a new method
b)
A for loop
c)
A while loop
d)
The run method
4.
Why does a programmer indent their code?
a)
Helps show the structure of the code.
b)
Easier for other people to understand.
c)
A key part of good programming style!
d)
All of the above
5.
Which of these is a valid Karel command in Java?
a)
MOVE
b)
move();
c)
move()
d)
move;
6.
Which of these is a valid Karel command in Java?
a)
turnLeft();
b)
turnleft();
c)
turnLeft()
d)
TurnLeft
7.
What is the name of the method that gets called to start a Java Karel program?
a)
move()
b)
run()
c)
start()
d)
go()
8.
Say you want to write a program to have Karel put down 300 tennis balls. Which control structure would you use?
a)
A nested while loop
b)
A while loop
c)
A for loop
d)
An if statement
9.
Say you want to write a program to have Karel to pick up all of the tennis balls in a location, but you don’t know how many tennis balls there are. Which control structure would you use?
a)
An if/else statement
b)
A while loop
c)
A for loop
d)
An if statement
10.

_________________ is giving the computer a set of commands.

a)

Debugging

b)

Programming

c)

the Internet

d)

Karel

11.

What is a "bug" in programming?

a)

an error in code

b)

finding and fixing errors in coding

c)

a network

d)

a broken computer

12.

Which Karel command is written correctly?

a)

move;

b)

Putball()

c)

turnLeft();

d)

move(;

13.

Every Karel command ends with a () and a ;.

a)

True

b)

False

14.

Which line contains the bug?

a)

1 and 5

b)

2 only

c)

3 only

d)

5 only

15.

Which command is written correctly?

a)

Move

b)

move

c)

Move();

d)

move();

16.

Which command is written incorrectly?

a)

putBall();

b)

putball();

c)

turnLeft();

d)

takeBall();

17.

Karel is a Cat?

a)

True

b)

False

18.

This code:

putBall();

move();

putBall();

put 2 balls in the same place and then move one place?

a)

True

b)

False

19.

The code in the picture will move Karel in a square.

a)

True

b)

False

20.

Which code below will put Karel in the position shown in picture?

a)

move(); Move(); turnLeft(); move();

b)

move; move(); turnLeft; move();

c)

move(); move(); TurnLeft(); Move();

d)

move(); move(); turnLeft(); move();

21.

Which code will put Karel in the position shown in second world?

a)

putBall(); putBall(); move(); move();

b)

move(); putBall(); move(); putBall();

c)

putBall(); move(); putBall(); move();

d)

move(); putBall(); putBall(); move();

22.

A Function takes one command and makes many commands from it.

a)

True

b)

False

23.

Is this Function written correctly?

a)

True

b)

False

24.

What is the name of this function?

a)

function

b)

spin()

c)

3 turnLeft();

d)

spin();

25.

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

a)

1

b)

2

c)

3

d)

4

26.

What can be used to teach Karel to turn right?

a)

Functions

b)

Variables

c)

Dog Treats

d)

Karel can already turn right

27.

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

a)

0

b)

1

c)

2

d)

However many you like

28.

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

a)

0

b)

1

c)

2

d)

However many times you like

29.

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

30.

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

31.

How many times does Karel move with this loop?

a)

9

b)

0

c)

10

d)

1

32.

What does this error mean?

a)

missing ( ) { }

b)

missing ;

c)

missing (

d)

there is no function in the program

33.

Why do we use if/else statements in JavaScript?

a)

To repeat something for a fixed number of times

b)

To either do something if a condition is true or do something else

c)

To break out of some block of code

d)

To repeat something while a condition is true