Structure Chart for University User Login Processing


MODULE: Validate_User()

IF UserID not in USER table THEN

    Display error_message

    Stop

ENDIF

Retrieve Password from USER table

IF #Trial(Password) = 3 THEN

     Deactivate_User(UserName)

     Exit application

ENDIF

Retrieve UserType from USER table

IF UserType = “student” THEN

     Open Student_Screen

ELSE IF UserType = “instructor” THEN

               Open Instructor_Screen

           ELSE IF UserType = “deactivated” THEN

                     Display deactivated_message

                     ENDIF

           ENDIF

ENDIF

 

MODULE: #Trial(password)

SET #Trial = 1

DO WHILE #Trial < 3

     IF password <> input_password THEN

         Display error_message

         Increment #Trial

     ELSE

         Exit DO

     ENDIF

END DO

Return #Trial

 

MODULE: Deactivate_User(UserID)

OPEN USER table

Retrieve User record based on UserID

Change type field to “deactivated”

CLOSE table