Inactive Tutor answered 5d
The answers for above questions are as below:
26: 23 --> As PIC 9(2) holds only 2 digits, leftmost digit is truncated.
27: ABC --> As PIC X(3) holds only 3 characters from the left.
28: PIC 9V99 has an implied decimal point (V) which is not displayed. It can be printed by moving to an edited field such as 9.99.
29: -1234 --> In PIC +ZZZ9, the + denotes sign means it displays + for positive values and - for negative values while the Zs suppresses unnecessary leading zeros.
30: 2 power 3 or 2 cube is 8. So, 8+2-1 = 9 because division takes precedence over subtraction.
31: 19.8 --> 12.82+7.07=19.89 but PIC 99V9 keeps only one digit after decimal point.
32: 2 --> 17/3 =5 leaving remainder 2.
33: 11 --> MOVE 5 TO AMOUNT makes AMOUNT=5. ADD 1 2 3 to AMOUNT adds all there numbers to it. So, 5+1+2+3=11
34: MULTIPLY NUM-CREDITS-IN BY 350 GIVING WS-TUITION-FEE.
MULTIPLY WS-TUITION-FEE BY .10 GIVING WS-HEALTH-COST.
ADD WS-TUITION-FEE WS-HELATH-COST 125 GIVING WS-TOTAL-BILL.
35: WORKING STORAGE SECTION:
01 WORK-AREA.
05 WS-DATE PIC X(8).
01 HEADER1.
05 FILLER PIC X(6) VALUE 'DATE: '.
05 HDR-MONTH PIC X(2).
05 FILLER PIC X VALUE '/'.
05 HDR-DAY PIC X(2).
05 FILLER PIC X VALUE '/'.
05 HDR-YEAR PIC X(4).
PROCEDURE DIVISION:
MOVE FUNCTION CURRET-DATE(1:8) TO WS-DATE
MOVE WS-DATE(5:2) TO HDR-MONTH
MOVE WS-DATE(7:2) TO HDR-DAY
MOVE WS-DATE(1:4) TO HDR-YEAR
WRITE REPORT-REC FROM HEADER1.
(Explanation: I declare a working storage variable WS-DATE as mentioned in question. Declared a header with the required date format to be printed on the report header. Then accepted the current date from system using function. Current date is in YYYYMMDD format. So, reference modification (5:2) pick month, (7:2) picks day and (1:4) picks year and the output will be formatted as "DATE: 06/22/2015".