QUESTION 1
Given the code below, determine the name of the loop control variable
BEGIN
Declare Integer x = 1
While ( x <= 5 ) Do
Input "Enter a number: ", x
Set x = x + 2
End While
END
Ans:_________
QUESTION 2
Determine the initial value for the loop control variable given the code below.
BEGIN
Declare Integer x = 1
Set x = 13
While ( x <= 5 )
Input "Enter a number: ", x
Set x = x+ 2
End While
END
Ans:___________
QUESTION 3
Determine the value by which the loop control variable is updated given the code below.
BEGIN
Declare Integer x = 13
While ( x <= 5 )
Input "Enter a number: ", x
Set x = x - 2
End While
END
Ans: ___________
QUESTION 4
Given the code below, determine the number of iterations the were performed by the looping structure.
BEGIN
Declare Integer x = 1
While ( x <= 5 )
Set x = x+ 2
End While
Display x
END
A.1
B.2
C.3
D.4
QUESTION 5
Given the code below, determine the number of iterations the were performed by the looping structure.
BEGIN
Declare Integer x = 13
While ( x <= 5 )
Set x = x+ 2
End While
Display x
END
A.None
B.1
C.2
D.3
QUESTION 6
Given the code below, determine the number of iterations the were performed by the looping structure.
BEGIN
Declare Integer x = 5
While ( x <= 5 )
Display "Hello World! "
End While
Display x
END
A.None
B.1
C.3
D.Infinite number of times [Endless Loop]
QUESTION 7
Given the code below, determine the output being generated after executing it.
BEGIN
Declare Integer x = 1
While ( x <= 5 )
Display x
Set x = x + 2
End While
END
A.1, 2, 3, 4, 5
B.1, 3, 5
C.1, 3, 5, 7
D.1, 2, 3, 4, 5, 6
QUESTION 8
Given the code below, determine the output being generated as a result of executing it.
BEGIN
Declare Integer x = 11
While ( x > 5 )
Display x
Set x = x - 5
End While
END
A.11, 6
B.11, 10, 9, 8, 7, 6, 5
C.11, 10, 9, 8, 7, 6
D.6, 10