/Homework 9 – October 25
Questions about fixed count iterations
Name ___________________ Language (circle the one to which the answers below apply) Pascal Java Ada
Definition: Fixed-count iterations (often referred to as FOR loops) are controlled by the loop control variable (abbreviated LCV)
char, int, double
only inside the loop if it is declared in the loop header, otherwise everywhere
yes but programmer shouldn’t do it
one unit more or less
than then modification value depending on whether the modification is
incrementing or decrementing
every time around the
loop
yes. if i is the loop control variable, the modification can be i++, i--, i=i+0.5
yes the modification
can be i --
no
with curly braces which are only needed
if there is more than one statement in the body
yes, with a break statement