SOLUTIONS TO REVIEW QUESTIONS:  Chapter 5  

II. General Questions 

1.    a. No. The paths have been reversed.
       b. Yes, they are the same.
       c. Yes, they are the same.

2. No, the flowchart is not drawn properly. The branches must be independent, thus there would be only one box each under the yes and no paths and the flow would rejoin at a small circle and then continue on to the last box which both paths use.


3a.    If AGE <= 17 
              add 1 to MINOR.

    The diagram would be a diamond with the text: 'AGE <= 17?'. The Yes path would go to a box with the message: 'Add 1 to MINOR' and then to the paths rejoin circle. The No path would go directly to the paths rejoin circle. 

3b.    If SIZE-IN > 500 
               add 1 to LARGE 
         ELSE add 1 to SMALL.

    The diagram would be a diamond with the text: 'SIZE-IN > 500?'. The Yes path would go to a box with the message: 'Add 1 to LARGE'. The No path would go to a box with the message: 'Add 1 to SMALL'. Then both flows would rejoin at a small circle.

3c.    If HOURS not = 40
                Perform 200-ERROR-ROUTINE.

  The diagram would be a diamond with the text: 'HOURS not = 40?'. The Yes path would go to a Predefined Process box with the message: '200-ERROR-ROUTINE' and then to the paths rejoin circle. The No path would go directly to the paths rejoin circle. 

3d.    Read GRADE.
         If GRADE >= 60
                Print 'PASS'
        ELSE Print 'FAIL'.

    The diagram would start with an I-O box (slanted sides) with the text 'Read GRADE' and then flow to a diamond with the text: 'GRADE >= 60?'. The Yes path would go to an I-O box with the message: 'Print PASS'. The No path would go to an I-O box with the message: 'Print FAIL'. Then both flows would rejoin at a small circle.


4.    a. Brackets [ ] mean the clause or paragraph is optional.
       b. Braces { } mean that exactly one of the enclosed items must be used.
       c. Uppercase words are COBOL reserved words which have special meaning to the compiler.
       d. Lowercase words represent user-defined entries.
       e. Underlined words are required in the format.
       f. The use of dots or ellipses (...) means that additional entries of the same type may be included 
            if desired.