Page 1 Computer Science 255 Second Hour Exam Name ______________________ Thursday, Oct. 3 90 pts. 1. (15 pts.) Explain what a file buffer is, the role that it plays, and the value of multiple buffering. 2. (5 pts.) How would you specify a blocking factor of 5 for the file EMP-FILE (EMP.DAT)? 3. (5 pts.) Consider the following sequence of keys: 10,14,16,3,17,19,12,3,18,42,91,88,90 What would the sequence of keys look like after the first distribution/merge phase of a mergesort? 4. (5 pts.) What is a key field? 4. (30 pts.) Suppose that the file WORK-STUDY contains records with the following organization: 01 WORK-STUDY-REC. 02 STUDENT-NO PIC X(5). 02 STUDENT-NAME PIC X(10). 02 HOURS PIC 99. 02 RATE PIC 99V99. The records are sorted by STUDENT-NO (which is the key for this record). A given student may have several records in the file. Write the procedure division entries necessary to read the records in the file and produce, for each student, a detail line with the student's name and total pay. Assume reasonable names for data division entries (i.e., you do not need to write data division entries). Additional work space for problem 4 5. (30 pts.) The file MAJOR-FILE contains 20 records organized as follows: 01 MAJOR-REC. 02 MAJOR PIC X(10). 02 DEPT PIC X(10). a. Write the DATA DIVISION entry necessary to create a table of 20 entries of this record type ordered in ascending order by MAJOR. Arrange things so that you can use a binary search on the table. b. Write the code necessary to load the table with records from the file c. Using the COBOL binary search verb, write the code necessary to search the table for the major "CSB" and display the name of the department if found. If not found, print an error message.