?

AP® Computer Science Principles

Free Version

Upgrade subject to access all content

Moderate

Iteration

APCSP-1TVKEE

Which of the following blocks of code are examples of iteration?

Select TWO choices below.

A
a ← RANDOM (1, 100)
IF (a < 50) 
{
    DISPLAY ("you win!")                
}
ELSE 
{
    DISPLAY ("you lose!")
}
B
a ← RANDOM (1, 100)
REPEAT 5 TIMES 
{
    aa * RANDOM (1, 100)            
}
DISPLAY  (a)
C
a50
WHILE a < 500 
{
    DISPLAY (a)
    a ← RANDOM (1, 750)            
}
D
a ← RANDOM (1, 100)
IF (a > 10) 
{
    DISPLAY ("you win!")                
}