***************** Assignment #3 for CS341 ********************* ***** ***** ***** Due: Tuesday 10/20/98 ***** ***** ***** ****************************************************************** One of the goals of this program is to gain familiarity with: (A) leaf subroutines including call and retl instructions. (B) non-leaf subroutines including (i) the save and restore instructions, (ii) the use of register windows, (iii) preliminary use of the stack, SP, and frame pointer. A small database of student records is stored in the data segment of your program. Each record has the following format: . . . where sid is the student id (this is an integer between 1 and 999) and status is one of P (on Probation) or N (Not on probation) or S (Suspended). This is followed by a list of pairs indicating the number of credit hours and grade for each course the student has enrolled for during that semester. The number of credit hours can be between 1 and 4. The grade can be only one of A+, A, A-, B+, B, B-, C or F. For example, a typical student record may be 372 N 3A- 4B+ 3A 3B- Each string is terminated by a null. Two successive fields are separated by between 0 and (a maximum of) 4 spaces. So, the following may also be stored: 372N 3 A-4B+3A 3B- in lieu of the record above. A student may be enrolled for a maximum of five and a minimum of one course per semester. Also, the maximum number of credit hours is 15 and the minimum is one. However a student on probation may only take up to a maximum of 10 credit hours. A total of three subroutines (find, gpa and val) are to be written and are described below. The main program prompts the user for a student id. It then calls "find" to determine whether that individual's record exists. If it does not exist in the database, "find" reports that to the user. If it does exist, it calls "gpa", passing the starting address of the record to it. "gpa" then calls "val" which checks for the validity of the record. In particular, "val" makes sure that, depending on status, the number of credit hours has not been exceeded. "gpa" then proceeds to compute the individual's GPA and new status using the rules below: (i) A student on probationary status is moved to non-probationary status if his/her GPA is greater than 1. (ii) A student on probation remains on probation if her/his GPA is greater than 0 and less than or equal to 1. (iii) A student on probation is suspended if he/she makes all F's. (iv) A student not on probation is moved to probation if her/his GPA is less than or equal to 1. (v) GPA is computed by taking the credit-weighted average of the grades earned. For this purpose the numerical equivalents of the grades are A+ -> 4.33, A -> 4.0, A- -> 3.67, B+ -> 3.33, B -> 3.0, B- -> 2.5, C -> 2.0, F -> 0.0 "gpa" conveys the new status and GPA to the main program which prints the record (reformatted if necessary for readibility), new status and GPA. Examples of the user/program interface: ---------------------------------------- Prog. -> Please enter student id User -> 1234 Prog, -> Sorry, invalid id. Prog. -> Please enter student id User -> 751 Prog. -> Sorry, no existing student record. Prog. -> Please enter student id User -> 123 Prog. -> 123 N 4A 3B+ 3A- Prog. -> New status = N, GPA = 3.7