SOLUTIONS TO REVIEW QUESTIONS: Chapter 8
Debugging Exercises
1. A record is written if AMT1 is not equal to 5400.
2. The period after ADD AMT3 TO TOTAL will cause a syntax error.
3. a. An alphanumeric field cannot be tested with a sign test.
b. There is no syntax error, although it is not appropriate to compare an alphanumeric
field to
a numeric literal. 800-RTN-X will always execute. If A = 6, it is not equal to 7
and thus the
statement is true. If A = 7, it is not equal to 6 and thus the statement is true.
c. A syntax error will not occur. A run-time error, resulting in a program interrupt
would occur
if the initial contents of B was not numeric.