Chapter 6

1. The term "debugging" means finding and correcting
errors in a computer program.

2. The method of "playing computer" involves going through
a computer program, statement by statement, assigning values to
variables and calculating results by hand.

3. A PRINT statement can be inserted into a program in
order to display the value of a variable.

4. The F4 key on a PC is used both to start and stop marking a
computer program.

5. The F4 key also removes marking from a program.

6. The easiest way to delete a block of program lines is to mark
or select the block, and then press the Delete key or execute the
Cut command.

7. (a) The F5 key copies a marked block to a new location.
(b) The F6 key moves a marked block to a new location.

8. The F7 key on a PC restores the last item deleted.

9. When a program has been stopped with the BREAK command,

(a) you can change the value of a variable,
(b) you cannot insert a new program statement,
(c) you cannot delete an existing program statement.

10. After a program has been stopped with the BREAK command, the
CONTINUE command restarts the program.

11. (a) An equality such as (X = 5) must be satisfiedexactly in
order to test a program condition. Round-off or conversion errors
sometimes give a false test.
(b) A better test expression is (abs(X - 5) < N) where N is
a small value.

12. (a) The statement USE marks the beginning of an error-handler
block.
(b) The statement END WHEN marks the end of the block.

13. (a) The system variable EXTEXT$ is assigned the error message.
(b) The system variable EXTYPE is assigned the error number.

14. (a) An algorithm is a technique, strategy, or formula for
solving a problem.
(b) You must thoroughly understand a problem before you can
develop an algorithm to solve it.

15. A written outline forces you to develop a more thorough
outline. You can and should refer to the outline as you write your
program.

16. Clearly written programs are easy to maintain, epecially
by persons other than the author. Maintenance of computer programs
is a major task in every commercial computing organization.

17. Budget as much time for testing a program as it took you
to write the program code.

18. (a) The DO FORMAT command converts a program to the standard
program format.
(b) This command capitalizes all keywords and indents the body
of program control structures.