If the condition is not met and the resulting outcome is False, the loop is never executed. You normally define this range in the initialization, with something like 1:100 to ensure that the loop starts. In other words, you are testing whether v’s current value is within a specified range. In the figure, this is represented by the diamond: the symbols mean “does the variable v’s current value belong to the sequence seq?”. One or more instructions within the initialization rectangle are followed by the evaluation of the condition on a variable which can assume values within a specified sequence. Note that, to keep things simple, other possible symbols have been omitted from the figure. Rhombi or diamonds, on the other hand, are called “decision symbols” and therefore translate into questions which only have two possible logical answers, namely, True (T) or False (F). In flowchart terms, rectangular boxes mean something like “do something which does not imply decisions”. This loop structure, made of the rectangular box ‘init’ (or initialization), the diamond or rhombus decision, and the rectangular box i1 is executed a known number of times.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |