187k views
1 vote
Which structure causes a statement or set of statements to execute repeatedly?

1) Start Over
2) Sequence
3) Decision
4) Repetition
5) None of these

User Ethan C
by
7.7k points

1 Answer

3 votes

The programming structure that allows for repeated execution of statements is the repetition or loop structure. It includes types like 'for loops' and 'while loops', which run a block of code multiple times under certain conditions.

The structure that causes a statement or set of statements to execute repeatedly is repetition. In programming, repetition structures, also known as loops, allow developers to execute a block of code multiple times. Common types of repetition structures include 'for loops', 'while loops', and 'do while loops'. For example, a 'for loop' in Python would look like:

for i in range(0, 5):
print("This is repetition number", i)

The above loop would print the statement five times, each with the current value of i. This demonstrates how a repetition structure creates a loop, allowing the same code to be executed several times over, usually with some form of a counter or a condition that terminates the loop.

The structure that enables repeated execution of statements is called repetition (Option 4).

User Yoerids
by
8.1k points