Page 1 Computer Science 255 First Hour Exam Name _____________________________ Friday, Sept. 27 100 pts. I. (15 pts.) Name the four divisions of a COBOL program, giving a brief description of each. II. (15 pts.) A local performing group needs to keep track of volunteers for productions. Records in the file have the following organization: Volunteer-record Volunteer name, consisting of last name (15 characters alphanumeric) first name (15 characters alphanumeric) Volunteer birthdate, consisting of Month (2 character numeric) Day (2 character numeric) Year (4 character numeric) Production, consisting of Fall/Spring/Winter code (2 characters alphanumeric) Year (4 characters numeric) Given these facts, write a complete COBOL record description for this record. Note that the record consists of three subfields which are further divided. III. (10 pts.) Suppose that we have the following: 01 STUFF. 02 FLD-A PIC X(3) VALUE "123456789". 02 FLD-B PIC X(10). 02 FLD-C PIC X(10) JUSTIFIED RIGHT. 02 FLD-D PIC XXXBXX/XXXX. What would be the effect of the following MOVE statements? Be sure to indicate any spaces by using a check mark. MOVE FLD-A TO FLD-B. FLD-B = _______________ MOVE FLD-A TO FLD-C. FLD-C = _______________ MOVE FLD-A TO FLD-D. FLD-D = _______________ IV. (15 pts.) Suppose that we have the following: 01 SOURCE-FIELDS. 02 SRC-C PIC S9(5)V99 VALUE 12345.67. 02 SRC-D PIC S9(5)V99 VALUE -12345.67. 02 SRC-E PIC S9(5)V99 VALUE 0.03. 01 TARGET-FIELDS. 02 DST-A PIC $$$$,$$$,$$$.$$CR. 02 DST-B PIC $***,***,***.**. 02 DST-C PIC $$,$$9.99. What would be the effect of the following MOVE statements? Be sure to indicate any spaces by using a check mark. MOVE SRC-C TO DST-A. DSC-A = __________________ MOVE SRC-C TO DST-B. DSC-B = __________________ MOVE SRC-D TO DST-A. DSC-A = __________________ MOVE SRC-E TO DST-C. DSC-C = __________________ MOVE SRC-C TO DST-C. DSC-C = __________________ (be careful with this last one!) V. (10 pts.) The variable TOTAL-SALES contains the total sales for a salesperson. If TOTAL-SALES is less than $10,000, then the salesperson's commission (COMMISSION) is 10% of the TOTAL-SALES. Otherwise, the COMMISSION is $1,000 plus 25% of the amount of TOTAL-SALES in excess of $10,000. Write the COBOL statement necessary to compute the salesperson's COMMISSION. VI. (35 pts.) On this and the following pages, write a complete COBOL program which will read records described in problem II (the VOLUNTEER-REC question) and which will print a report with one line for each volunteer, printing the volunteer's full name and birthdate. No headers or footers are required for this exercise. a. (5 pts.) Write the IDENTIFICATION DIVISION entries for this question. b. (10 pts.) Write the ENVIRONMENT DIVISION entries for this question. c. (10 pts.) Write the DATA DIVISION entries for this question. Please note that no headers and footers are required, and the file description has already been written in problem #2 - in the following you do not need to write it down again, but simply put a note where it belongs. The FD and WORKING- STORAGE entries should, however, go here. d. (10 pts.) Finally, write the PROCEDURE DIVISION entries for this question. No documentation is necessary.