Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pseudocode - Iteration

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

Which type of iteration should be used when you know how many times you want to loop?

a)

Count Controlled

b)

Condition Controlled

2.

Which type of iteration should you use if you don't know how many times you need to loop?

a)

Condition Controlled

b)

Count Controlled

3.

What is missing?


____ i = 1 To 10

OUTPUT: "String"

ENDFOR

a)

FOR

b)

FOUR

c)

WHILE

4.

Fill in the missing blank:


_______ variable <> "Hi"

OUTPUT: "Hi to you!"

ENDWHILE

a)

WHILST

b)

WHILE

c)

FOR

d)

IF

5.

Pick the correct answer to match the following:


A loop that will check the condition before the code inside is executed.

a)

FOR

b)

WHILE

c)

REPEAT...UNTIL

6.

Pick the correct answer to match the following:


A loop that will check the condition after the code inside is executed.

a)

WHILE

b)

REPEAT...UNTIL

c)

FOR

7.

Which of the following will run 10 times? (Choose all that apply.)

a)

FOR i = 1 TO 10

OUTPUT: "Number " + i

ENDFOR

b)

FOR i = 0 To 10

OUTPUT: "Number: " + i

ENDFOR

c)

input = 10

count = 1

WHILE count <= input

OUTPUT: count

count = count + 1

ENDWHILE

8.

Complete the blank:


" (a)   is the process of repeating an action multiple times."

9.

Which of these is the correct syntax? (Choose all that apply.)

a)

FOR i = 1 TO 10

b)

WHILE i != 10

c)

FOR i = 1 <- 10

d)

WHILE i <> 10

10.

How many times will the following loop run?


myString = "A word"


FOR i = 1 TO LENGTH(myString)

'Do something

ENDFOR

a)

6

b)

5

c)

10