Question 1 of 10
count starts at 0. What is displayed after the loop?
count ← 0
REPEAT 2 TIMES
{
count ← count + 5
}
DISPLAY (count)
- A. 5
- B. 7
- C. 10
- D. 2
count starts at 0. What is displayed after the loop?
count ← 0
REPEAT 2 TIMES
{
count ← count + 5
}
DISPLAY (count)
j starts at 0. How many times is DISPLAY executed?
j ← 0
REPEAT UNTIL (j >= 4)
{
j ← j + 1
DISPLAY ("tick")
}
r starts at 1. What values are displayed?
r ← 1
REPEAT UNTIL (r = 1)
{
DISPLAY (r)
r ← r + 1
}
n starts at 9. Final n?
n ← 9
REPEAT UNTIL (n < 5)
{
n ← n - 2
}
How many left rotations?
REPEAT 3 TIMES
{
ROTATE_LEFT
}
a starts at 0, b at 5. Final a?
a ← 0
b ← 5
REPEAT UNTIL (a >= b)
{
a ← a + 2
}
s starts at 4. What is printed?
s ← 4
REPEAT UNTIL (s <= 1)
{
DISPLAY (s)
s ← s - 1
}
q starts at 2. Body executions for REPEAT UNTIL (q > 2) { q ← q + 1 }?
total starts at 1. DISPLAY shows?
total ← 1
REPEAT 4 TIMES
{
total ← total * 2
}
DISPLAY (total)
w starts at 7. Does the body run?
w ← 7
REPEAT UNTIL (w < 10)
{
w ← w + 1
}