Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Sample Pseudocode for "Update of Student Schedules"

Navigation:
Start at main menu - select student option; click on continue
At student menu - key in social security number; click on Update Schedules

[ssn is a global field]

Display Student Schedules SHOW screen 1.4


DISPLAY the ssn in the txtSSN box
FINDFIRST record in the student table for the ssn
[should be the only record in student table for the ssn--WHY?]
IF nomatch
DISPLAY 'name not found' in txtNAME box
ELSE
DISPLAY student name in txtNAME box
ENDIF
STORE the name in the textbox as a global variable
FINDFIRST record in the student class table for the ssn
IF nomatch on student class table
DISPLAY 'no classes' in the first text box for TITLE
ELSE
SETFOCUS on the first CourseID/Secton textbox (control array -- index is 0)
LOOP WHILE index < 6 and nomatch on student-class table is FALSE
FINDFIRST record on the class file for the CourseID/Section on student-class table
IF nomatch on class table
DISPLAY 'no class record found' in txtTITLE (index indicates the line number)
ELSE
DISPLAY course-id, building, room, start time, days in the appropriate text boxes
(index indicates line number)
FINDFIRST record on the course table for the course-id displayed above
IF nomatch on course table
DISPLAY 'no course record found' in txtTITLE
ELSE
DISPLAY title in the appropriate textbox (index indicates line number)
ENDIF
ENDIF
FINDNEXT record on student class table
IF nomatch on student class
SET index to 7
HIDE the next page command button
ELSE
INCREMENT index by 1
END IF
END LOOP
END IF

If the update command button is clicked:


SETFOCUS on the first Delete check box (index is 0)
LOOP WHILE index < 6 and courseID/Section in text box (index = line number) is NOT blank
IF the Delete Button is Clicked
Delete the record with the CourseID/Section and the SSN from the student class file
ENDIF
INCREMENT index by 1
END LOOP
IF the NEW CourseID/Section is not blank
FINDFIRST class record for the courseID/section in the textboxes
IF number enrolled < class limit
THEN
INCREMENT the number enrolled
Update the class table
ADDNEW record to the student class table
ELSE
MsgBox "class is closed"
ENDIF
ENDIF
SETFOCUS on the first CourseID/Section textbox (control array -- index is 0)
LOOP WHILE index < 6 and nomatch on student-class table is FALSE
FINDFIRST record on the class file for the CourseID/Section displayed above
IF nomatch on class table
DISPLAY 'no class record found' in txtTITLE (index indicates the line number)
ELSE
DISPLAY building, room, start time, days in the appropriate text boxes
(index indicates line number)
FINDFIRST record on the course table for the course-id displayed above
IF nomatch on course table
DISPLAY 'no course record found' in txtTITLE
ELSE
DISPLAY title in the appropriate textbox (index indicates line number)
ENDIF
ENDIF
FINDNEXT record on student class table
IF nomatch on student class
SET index to 7
HIDE the next page command button
ELSE
INCREMENT index by 1
END IF
END LOOP

You might also like