1. One cause of a SIZE ERROR is division by zero.
A.True
B.False


2. Following the rule-of-thumb to determine the size of the resulting field,
the PIC of RESULT should be 9(4) for the following:
   DIVIDE AMT1 BY AMT2 GIVING RESULT
where AMT1 has PIC 999 and AMT2 has PIC V9.
A.True
B.False


3. A size error will occur in the following statement if RESULT has PIC 9:
DIVIDE 7 BY 3 GIVING RESULT
A.True
B.False


4. The ON SIZE ERROR clause can be used with all arithmetic statements.
A.True
B.False


5. The ROUNDED clause may not be used with a COMPUTE statement.   
A.True
B.False


6. The following is a correct COBOL statement:
   ADD AMOUNT TO 100      
A.True
B.False


7. TOTAL needs to have an initial value before the following statement is executed:
   ADD TICKET-PRICE SALES-TAX GIVING TOTAL   
A.True
B.False


8. In the following statement, TICKET-PRICE may be a report-item:
   ADD TICKET-PRICE SALES-TAX GIVING TOTAL
A.True
B.False


9. If NUM has PIC 9V9, after the following statements are executed, NUM will have the value 5.0:
   MOVE 1 TO NUM
   ADD 3.68 TO NUM ROUNDED
A.True
B.False


10. If an input record has a value -68, what is an appropriate PIC clause for the corresponding field NUM in the input record description?
________________________________________________________________________

Answer:


11. After the following two statements are executed, what value is in AMOUNT?
   MOVE 10 TO AMOUNT
   SUBTRACT 4 FROM AMOUNT GIVING TOTAL ________________________________________________________________________

Answer:


12. After the following two statements are executed, what value is in AMOUNT?
   MOVE 10 TO AMOUNT
   SUBTRACT 4 FROM AMOUNT ________________________________________________________________________

Answer:


13. What is the value in AMOUNT after the following statements are executed?
   MOVE 8 TO AMOUNT
   DIVIDE 2 INTO AMOUNT GIVING TOTAL ________________________________________________________________________

Answer:


14. What is the value in AMOUNT after the following statements are executed?
   MOVE 8 TO AMOUNT
   DIVIDE 2 INTO AMOUNT ________________________________________________________________________

Answer:


15. What is the value in AMOUNT after the following statement is executed?
   COMPUTE AMOUNT = 2 ** 3 + 6 / 3 - 2
________________________________________________________________________

Answer:


16. Following the rule-of-thumb to determine the size of the resulting field, what should the PIC of RESULT be for the following:
   ADD AMT1 AMT2 GIVING RESULT
where AMT1 has PIC 999 and AMT2 has PIC 999?______________________________

Answer:


17. Recode the following using a COMPUTE: ADD 1 TO Y.
________________________________________________________________________

Answer:


18. To calculate the average of A, B, C, D and place the result in AVG, write the COBOL code using the verb COMPUTE and an intrinsic function:__________________

Answer:


19. To store a 4 digit negative value in field AMOUNT, AMOUNT must have PIC_____

Answer:


20. All of the following are correct ADD statements in COBOL EXCEPT:
A.ADD 15 20 30 GIVING TOTAL
B.ADD REGULAR-PAY TO 250
C.ADD BONUS TO REGULAR-PAY GIVING TOTAL-PAY
D.ADD 15 TO AMOUNT
E.ADD AMOUNT1 TO 30 GIVING AMOUNT2


21. Which of the following SUBTRACT statements is NOT correct?
A.SUBTRACT NUM1 NUM2 FROM NUM3
B.SUBTRACT NUM1 NUM2 NUM3 FROM AMOUNT1 AMOUNT2
C.SUBTRACT NUM1 FROM 10 GIVING NUM2
D.SUBTRACT NUM FROM 25
E.SUBTRACT NUM1 FROM NUM2


22. Which of the following MULTIPLY statements is NOT correct?
A.MULTIPLY NUM1 BY 5 GIVING RESULT
B.MULTIPLY 5 BY NUM
C.MULTIPLY NUM1 BY NUM2 BY NUM3 GIVING RESULT
D.MULTIPLY 5 BY 10 GIVING RESULT
E.MULTIPLY NUM1 BY NUM2


23. Which of the following DIVIDE statements is NOT correct?
A.DIVIDE NUM1 BY NUM2
B.DIVIDE NUM1 INTO 10 GIVING RESULT
C.DIVIDE NUM1 BY NUM2 GIVING TOTAL
D.DIVIDE NUM1 INTO NUM2 GIVING TOTAL
E.DIVIDE NUM1 INTO NUM2


24. Which operation is evaluated first in the following statement?
COMPUTE Y = A * B + C ** D / E - F
A.A * B
B.B + C
C.C ** D
D.D / E
E.E – F



This is the end of the test. When you have completed all the questions and reviewed your answers, press the button below to grade the test.