Page 1 Computer Science 255 Second Hour Exam Name ______________________ Friday, Oct. 25 100 pts. 1. (10 pts.) List the major elements of a report and give a brief description of each. 2. (15 pts.) A file of parts has the following record format: FD PARTS-FILE DATA RECORD IS PARTS-REC. 01 PARTS-REC. 02 PNO-IN PIC X(5). 02 PNAME-IN PIC X(10). 02 AMT-ON-HAND PIC 999. 02 UNIT-COST PIC 999V99. Write the format 1, 2 and 3 lines necessary to describe a detail line for a report printing the information in this file. Use suitable formatting for numeric (AMT-ON-HAND) and currency (UNIT-COST) items. 3. (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.