Represent algorithmic processes without using a programming language.
Implement and apply an algorithm.
Determine the result of code segments.
Learning Objective: Express an algorithm that uses iteration without using a programming language.
Iteration is a repeating portion of an algorithm. Iteration repeats a specified number of times
or until a given condition is met.
Learning ObjectiveFor iteration:
a. Write iteration statement
b. Determine the result or side effect of iteration statements.
Iteration statements change the sequential flow of control by repeating a set of statements zero or more times, until a stopping condition is met.
AAP-2.K.2
The exam reference sheet provides
Text:
REPEAT n TIMES
{
<block of statements>
}
The exam reference sheet provides
Text:
REPEAT UNTIL(condition)
{
<block of statements>
}
In REPEAT UNTIL(condition) iteration, an infinite loop occurs when the ending condition will never evaluate to true.
AAP-2.K.5
In REPEAT UNTIL(condition) iteration, if the conditional evaluates to true initially, the loop body is not executed at all, due to the condition being checked before the loop