Homework Assignment #2
Due: 11/11/2002 (MW) & 11/12/2002 (TTH)
One of the functions/methods needed by the “Student Advisement System” is to check to see whether each prerequisite for each course in a requested concentrated studies package is “taken care of” (i.e., is also in the package, is in the core set of courses required of all computer science majors, or has already been taken by the student). For this function/method of the system only, do the following:
By way of a flowchart, block diagram, or pseudo code (the choice is yours) specify the details of this module, call it checkCoursePrerequisites( ), and write a protocol/interface description for it. (You may be able to use one created as part of your team’s high-level design project if one was written for such a module.) Refine this module (i.e., create sub-modules or other functions/methods) as necessary to improve cohesion. For each new module created provide a protocol/interface description. Additionally, if the module is complex, also specify the processing details as a flowchart, block diagram, or pseudo-code.
The function/method checkCoursePrerequisties( ) is passed the id of the student and the course to check. You may assume the existence of a sub-module/method, getStudentCourses( ) (which you need not specify the details of), to access the University's database of student information and return a list of all courses taken and grades received for a given student as specified by student id number. Assume that the list is returned as an array of strings where each string (row of the array) contains the information about a particular class. Each string contains the following information:
· The first 5 characters identify the department (e.g., COMP).
· The next 8 characters identify the course number (e.g., 396SEL).
· The next 2 characters identify the grade received in the course (e.g., B+).
· All strings are left justified.
If the grade is blank it means that the student is currently taking that course. Note: A student may have taken a course multiple times. In such a case it is the highest grade that counts. If you prefer, you can assume an alternate form for the list returned, like a linked list of structures, a single character string, etc., but be sure to document any data representation assumptions that differ from those specified above.
Likewise, if you need them, you may assume that there are sub-modules/methods, getCoreCourses( ), getCSPCourses( ), and getCoursePrerequisites( ), to get a list of all required courses as specified by major and catalog year, a list of the courses specified in the current concentrated studies package, and a list of all prerequisite courses for a given course, respectively. You may assume that the lists returned by these functions/methods are of the same form as specified for getStudentCourses( ) where the grade field is blank for the core courses list and the concentrated studies package list and is the required passing grade for the prerequisites. You may also assume that there are no cases where alternative prerequisites are specified (as in "either Comp 222 or Comp 232 is required"). That is, you may assume each course specified as a prerequisite is required. You need not specify the details of these modules.
Note: You will need to make a copy of your detail design so you can give
one to someone to review and turn one in to be graded. Please give the original
to the peer reviewer and the copy to the instructor.