Difference between revisions of "W1154 For Loop"

From Coder Merlin
Line 2: Line 2:
== Prerequisites ==
== Prerequisites ==
* [[W1151 Conditional and Flow Chart]]
* [[W1151 Conditional and Flow Chart]]
== Background ==
(Use when required for background reading)
== Introduction ==
== Introduction ==
Loops are the general term for ''executing a defined segment of code zero or more times'', where the number of iterations is dependent upon test conditions within the loop.  The '''for loop''' is a construct which enables us to execute a segment of code a ''defined number'' of times.  It is thus the most appropriate choice when we know in advance how to calculate the number of iterations prior to beginning the loop.  While this construct is not strictly necessary, it provides syntactic sugar by clarifying intent.
== Topic Headers ==
== Topic Headers ==
== Key Concepts ==
== Key Concepts ==
== Exercises ==
== Exercises ==
== References ==
== References ==

Revision as of 17:12, 5 January 2020

Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Roller Coaster Loop

Prerequisites[edit]

Introduction[edit]

Loops are the general term for executing a defined segment of code zero or more times, where the number of iterations is dependent upon test conditions within the loop. The for loop is a construct which enables us to execute a segment of code a defined number of times. It is thus the most appropriate choice when we know in advance how to calculate the number of iterations prior to beginning the loop. While this construct is not strictly necessary, it provides syntactic sugar by clarifying intent.

Topic Headers[edit]

Key Concepts[edit]

Exercises[edit]

References[edit]