Algorithm Structure

 The keyword:    END, and a title identify the algorithm.
  
Sample format:

    Descriptive_Algorithm_Title
        statement(s)
    END
________________________________________________________________
statement(s) can be control structures as well as simple statements.
we use indentation to indicate the 'body' of an algorithm and/or structure

________________________________________________________________
IF structure

The keywords:    IF ,THEN,  ELSE (if needed), ENDIF   identify the structure.  

Sample formats:

    IF condition THEN                                                   
        statement(s)
    ENDIF                                            

    IF condition THEN                                                         
        statement(s)
    ELSE
        statement(s)
    ENDIF

    IF condition THEN
        statement(s)
    ELSE
        IF condition THEN
            statement(s)
        ELSE
            statement(s)
        ENDIF
   ENDIF

(each IF or IF-ELSE combo has an associated ENDIF)
________________________________________________________________

CASE structure

The keywords:    CASE OF , ENDCASE   identify the structure.  

Sample Format:

    CASE OF single variable
            value_1: statement block_1
            value_2: statement block_2
                .
                .
                .
            value_n: statement block_3
            value_other: statement block_other
    ENDCASE
________________________________________________________________

WHILE structure

The keywords:    WHILE ,ENDWHILE   identify the structure.

Sample Format:
                                   
    WHILE (condition)
        statement(s)
    ENDWHILE

   (remember to initialize the while condition variable before testing it !)
   (remember to modify the condition variable within the loop so you get out eventually!)

________________________________________________________________

FOR structure

The keywords:    FOR, ENDFOR identify the structure.

Sample Format:

    FOR (counter = start_value to/downto stop_value)
        statement(s)
    ENDFOR
________________________________________________________________