Chapter 10

1. The following format characters are allowed in a format
string:

(a) # yes (f) ; no
(b) % yes (g) * yes
(c) $ yes (h) + yes
(d) ? no (i) = no
(e) < yes (j) - yes

2. Semicolons cannot be used to separate items in a PRINT
USING statement.

3. A trailing semicolon is allowed in a PRINT USING statement
and it suppresses the usual carriage return and line feed.

4. If the number 12345 is printed with the format string "####",
the error string **** is displayed because this format string is
too short for the number.

5. (a) The format string "$$###" is a valid format string.
(b) The format string "%%###" is not allowed because the
characters % and # cannot be used together in the same format
string.

6. (a) When the number 12.5 is formatted with the format string
"-##.##", the value-12.50 is displayed.
(b) When the same number is formatted with the format string
"+##.##", the value +12.50 is displayed.

7. The format string "$$,$$$.##" is not valid because commas
cannot be inserted between dollar signs.

8. The format string ">###" can only be used to print string
variables or constants, not numeric variables.

9. The format string "###" is not long enough to print the
number -999, a minimum of four format characters is required.

10. (a) The string "THE" is centered in the field defined by
the format string "#####".
(b) This same format string is too short to display the
string "THE END" and the error string ***** is displayed.

11. A single format string, such as "#####", can be used to
display both string and numeric values. The format string characters
must, of course, be legal characters for displaying both strings
and numbers.

12. The statement "OPEN #9: PRINTER" designates the printer
as file #9.

13. The statement "PRINT #1, using Format$: Number" prints
the value of Number on file #1, using the format string Format$.

14. (a) The CLEAR statement clears the display screen.
(b) After the statement is executed, the cursor is in the
upper left corner of the screen.

15. The display unit is designated as channel or file #0.

16. A sentinel value in a data file tells the program that the
end of the file has been reached.

17. The statement "SET cursor A, B" moves the cursor to row A
and column B. Variable A is the row number and variable B is the
column number.

18. (a) If the statement "ASK max cursor Height, Width" has been
executed, the statement "SET cursor Height/2, Width/2" moves the
cursor to the center of the display screen.
(b) The statement (SET cursor "off") turns off the cursor.

19. On a normal display screen, the statement "ASK max cursor A, B"
assigns a value of 25 to A and 80 to B.

20. The statement "GET KEY Dummy" assigns the ASCII or other
numeric code value of the last key pressed to the variable
Dummy.

21. If a window is opened as window #1, you can open a file
as file #2, but not as file #1.

22. (a) Window dimensions are specified by a coordinate system
whose origin is at the lower left corner, with horizontal and
vertical coordinates running from zero to one.
(b) The cursor position is specified by a coordinate system
whose origin is at the upper left corner. The vertical coordinate
is positive downwards from one to the number of rows, while the
horizontal coordinate runs from one to the number of columns.

23. (a) The statement "OPEN #3: screen Left, Right, Bottom, Top"
opens window #3.
(b) The statement "WINDOW #3" moves the cursor to window #3.
(c) The statement "CLOSE #3" closes window #3.

24. The SET CURSOR statement controls the position of the
cursor within a window, but cannot be used to move the cursor from
one window to another.