Skip to main content\(
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 3.1 WriteLoops-Subgoals
Subgoals for Writing a Loop.
-
Determine purpose of loop
Pick a loop structure (while, for, do_while)
Define and initialize variables
-
Determine termination condition
Invert termination condition to continuation condition
-
Write the loop body
Update Loop Control Variable to reach termination
You have attempted
of
activities on this page.