wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CodeHS 1.9 & 1.10 Loops

Total questions: 9

Worksheet time: 7mins

Name
Class
Date
1.

for(int i = 0; i < 100; i++)

a)

iterative

1.

programming that repeats

b)

sequential

2.

programming that doesn't repeat

c)

int i = 0

3.

runs at the start of the first loop

d)

i < 100

4.

runs at the start of each loop

e)

i++

5.

runs at the end of each loop

2.

How many balls does Karel put down?

(a)  

3.

How many balls does Karel put down?

(a)  

4.

Sweet Caroline

a)

bum bum bum

b)

Good times never seemed so good

c)

I've been inclined

d)

This is a trick question

5.

What is the best code to replace condition in this code to make Karel move to the wall in front of her?

a)

facingNorth()

b)

frontIsClear()

c)

noWallsPresent()

d)

facingWall()

e)

true

6.

What does this code do?

a)

Puts down a row of balls

b)

Puts down a column of balls

c)

Puts down balls in a line up to the wall

d)

Removes all of the balls along a path to the wall

7.

What kind of program structure is a while loop?

a)

infinite look

b)

iterative

c)

sequential

d)

selection

8.

Why would we use a while loop instead of a for loop?

a)

we don't know how many times we want to run the loop

b)

we know how many times we want to run the loop

c)

It's a structure that is more efficient to code and execute

d)

it's best practicies

9.

What fruit is a good source of potassium and grows on a flowering herb?

(a)