Class Exercise:  Repetition Structure


Description: 
    A repetition structure, or "loop", controls the execution of a block 
    of statements. A conditional expression is tested to determine 
    whether processing is to continue. The statement block is repeated
    as long as the condition is true.

1.  Repeat a statement (block) forever. Include statements to print then
    increment the loop count.







2.  Make a counter-controlled loop that repeats as long as a variable named 
    count is less than another variable named limit.  Initialize count 
    to 1 and limit to 5.  The statement block should print the count and
    its square, and also increment count.









3.  Code a sentinel-controlled loop that repeats as long as a sentinel value
    has not been encountered.  Declare and assign initial values to needed 
    variables. Input a numeric value.  Within the loop statement body, add 
    the number input to an accumulator named sum.  Input another number
    and repeat until the sentinel value is detected, then print the sum.








4.  Construct a flag-controlled loop that uses a variable named done to 
    signal when looping is to end.  Initialize done to false and totalPoints
    to zero.  The loop should continue as long as done remains false.  The 
    loop body should have a prompt and input statement for a value named points,
    add points to totalPoints, test totalPoints, and when it is >= some maximum 
    value, assign true to done. After looping terminates, print totalPoints.