MAIN-LINE.
PERFORM DO-SETUP.
PERFORM DO-NESTED-IF.
PERFORM DO-EVALUATE.
STOP RUN.
DO-SETUP.
DISPLAY 'Enter a digit '.
ACCEPT KBD-ENTRY.
DO-NESTED-IF.
IF KBD-ENTRY = '1'
DISPLAY 'Freshman'
ELSE IF KBD-ENTRY = '2'
DISPLAY 'Sophomore'
ELSE IF KBD-ENTRY = '3'
DISPLAY 'Junior'
ELSE IF KBD-ENTRY = '4'
DISPLAY 'Senior'
ELSE IF KBD-ENTRY = '5'
DISPLAY 'Graduate'
ELSE
DISPLAY 'Undefined code'
END-IF
END-IF
END-IF
END-IF
END-IF.
DO-EVALUATE.
EVALUATE KBD-ENTRY
WHEN '1' DISPLAY 'Freshman'
WHEN '2' DISPLAY 'Sophomore'
WHEN '3' DISPLAY 'Junior'
WHEN '4' DISPLAY 'Senior'
WHEN '5' DISPLAY 'Graduate'
WHEN OTHER DISPLAY 'Undefined code'
END-EVALUATE.