WorksheetsPsuedocode iterations
Total questions: 45
Worksheet time: 19mins
Which type of iteration should be used when you know how many times you want to loop?
Count Controlled
Condition Controlled
Which type of iteration should you use if you don't know how many times you need to loop?
Condition Controlled
Count Controlled
What is missing?
____ i <-- 1 To 10
OUTPUT "String"
ENDFOR
FOR
FOUR
WHILE
Fill in the missing blank:
_______ variable <> "Hi"
OUTPUT "Hi to you!"
ENDWHILE
WHILST
WHILE
FOR
IF
Pick the correct answer to match the following:
A loop that will check the condition before the code inside is executed.
FOR
WHILE
REPEAT...UNTIL
Pick the correct answer to match the following:
A loop that will check the condition after the code inside is executed.
WHILE
REPEAT...UNTIL
FOR
Which of the following will run 10 times? (Choose all that apply.)
FOR i = 1 TO 10
OUTPUT: "Number " + i
ENDFOR
FOR i = 0 To 10
OUTPUT: "Number: " + i
ENDFOR
input = 10
count = 1
WHILE count <= input
OUTPUT: count
count = count + 1
ENDWHILE
Complete the blank:
" (a) is the process of repeating an action multiple times."
Which of these is the correct syntax in pseudocode? (Choose all that apply.)
FOR i <-- 1 TO 10
WHILE i != 10
FOR i <-- 1 <- 10
WHILE i <> 10
How many times will the following loop run?
myString <-- "A word"
FOR i <-- 1 TO LENGTH(myString)
OUTPUT "Do something"
NEXT i
6
5
10
Post-condition loops _______
always have at least one iteration
NO iterations
Multiple
None
What is used to assign values in pseudocode?
:
=
==
<--
Pre-condition loops may have ______
no iterations
always has at least one iteration
may have multiple iterations
None
The number of iterations (print the value of M) is ...................
2
3
4
5
This symbol refers to .......................... in flowcharts
Input/output
Process
Decision
Terminal
The Procedures term refers to: ..........................
properties that describe the object.
Events that can occur to the object.
Commands and instructions that are carried out.
This flowchart used in solving the speed of movement body by measuring the distance “D” and Time “T”.
(1) The condition which is used in preventing user from input number zero as a denominator of the speed law is ...........................
T=0
T>0
T<D
D=0
This flowchart used in solving the speed of movement body by measuring the distance “D” and Time “T”.
(2) ……………………………………….. is the process that calculate a speed of movement body.
T/D
D*T
D/T
D<0
This flowchart used in solving the speed of movement body by measuring the distance “D” and Time “T”.
(3) Which shape is used to define the output of the program ………………………………………………. .
D<0
When a piece of code runs unintentionally forever it is known as
An infinite loop
A long loop
A broken loop
A for loop
A condition is
a statement that is either True or False
a string
an integer
a list
What does the code output?
0
1
2
3
1
2
3
0
1
2
What does the code output?
hi
It won't output anything
It will output an error!
It will output "hi" infinitely
What does the code output?
hi
bye
hi
bye
hi
bye
hi
bye
hi
hi
hi
bye
What does the code output?
3
6
7
4
What does the code output?
hi
hi
hi
hi
hi
hi
hi
hi
hi
hi
What does the code output?
3
4
5
1
2
3
3
4
5
6
3
4
4
What is the value of i after this loop runs?
i = 20
i = 19
i = 10
i = 0
What does this program output?
x is 0
x is 1
x is 3
x is 4
A post condition loop will use the following
REPEAT ... UNTIL
FOR ... NEXT i
WHILE ... ENDWHILE
A pre condition loop use the following
REPEAT ... UNTIL
FOR ... NEXT i
WHILE ... ENDWHILE
A count controlled loop use the following
REPEAT ... UNTIL
FOR ... NEXT i
WHILE ... ENDWHILE
What is a Count-Controlled loop?
for loop
while loop
A count controlled loop will..
Repeat code until a condition is met
Repeat code a specific amount of times
Repeat code a random amount of times
None of the above
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
What sort of loop is this?
Count Controlled
Condition Controlled
What will this code print?
Print the word 'letter'.
Print a user input on one line.
Print a user input one letter at a time.
Print an Error.
Which of these is NOT a loop in python?
for loop
while loop
nested loop
if loop
Which of these operators in Python means EQUAL TO?
'='
'=>'
'<='
'=='
What will be the output of this code?
1,2,3,4,5,6,7,8,9,10,11,12
0,2,4,6,8,10
2,4,6,8,10,12
2,4,6,8,10
What does the '#' allow you to do in Python?
Repeat code
Comment on code
Print code
End code
Which of these will allow me to count from 0-20 in steps of 5?
for x in range(0,20):
print(x)
while x = (0,20,5):
print(x)
for x in range(0,21,5):
print(x)
for x in range(0,21,5):
print(y)
If i want to continuously check for a correct answer, what loop would i use?
for loop
while loop
What is the error in this code?
incorrect variable name
incorrect indentation
incorrect speech marks
incorrect loop
A condition controlled loop is...
A while loop
A for loop
