Control Structure and Loops Flashcards

1
Q

Control Structures

A

A control structures include loops, also known as “iteration”, which the code repeat code as many times as needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Unconditional loop

A

The classic unconditional loop is FOR…NEXT where a loop variable is used to keep count of the number of iteration with the NEXT line in this structure used to determine when the loop is complete.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Pre-conditional loops

A

Conditional loops will continue until an event occurs or a condition is met.
The condition can be at the start, e.g. WHILE, which is known as pre-conditioned loop, so the code inside the loop will not be run at all if the condition is not met when this structure is executed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Post-conditional

A

If the condition is at last at the end e.g. REPEAT UNTIL or LOOP UNTIL, it is a post-conditional loop so code inside the loop will run at least once, even the condition has is not met as the test is after the body of the loop. These structure offers the programmer more control over how the loop will work.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly