Chapter 3
1. The assignment operator is the equal sign (=).
2. The word LET is required in an assignment statement
unless the NOLET option is specified in the program.
3. The last character in a string variable name must be a
dollar sign ($), while a numeric variable name cannot contain a dollar
sign.
4. The statement LET B = B/2 is a legal statement because
the equal sign is being used as an assignment operator.
5. The old value stored in a variable is erased when a new
value is assigned to that variable.
6. (a) The initial value of a numeric variable is the
number zero.
(b) The initial value of a string variable is the null
string.
7. A space character cannot be used as part of a variable
name.
8. A variable name may contain an unlimited number of
characters in Version 3, but only up to 31 characters in previous
versions.
9. (a) 'Ending' is a legal variable name.
(b) '2ndEnding' is not legal, it starts with a digit.
(c) 'Spare Tire' is not legal, it contains a space.
(d) 'NoSuchLuck' is a legal name.
10. The expression "Value$ + 2" is not valid because a string
variable cannot be used in an arithmetic expression.
11. (a) "LET Value = 1,230,000" is not valid, commas cannot
be used in numbers.
(b) "LET Value = 1.23e6" is a valid statement.
(c) "LET Value = 15%" is not valid, percent signs cannot
be used in numbers.
(d) "LET Value = $12.95" is not valid, dollar signs cannot
be used in numbers.
12. (a) "LET X = 1 - 2 / 2" assigns 0 to X.
(b) "LET X = 2 ^ 3 - 1 / 2" assigns 7.5 to X.
(c) "LET X = 1 + 2 - 3 * 4 / 2" assigns -3 to X.
(d) "LET X = 2 + 2 / 2 + 2" assigns 5 to X.
13. A string variable can be assigned a string containing at
least 32,767 characters.
14. Name$ has been assigned the value "Bill Wilson".
(a) The substring Name$[6:11] has a value of "Wilson".
(b) The substring Name$[1:4] has a value of "Bill".
15. The expression (Prefix$ & Suffix$) has a value of
"forever".
16. The statement "LINE INPUT Cost" is not a valid statement
because LINE INPUT can only be used with a string variable.
17. A DATA statement can be placed anywhere in a program.
18. The value 3 is assigned to the variable A.
19. If the number of variables in the READ statement is
greater than the number of values in the DATA statement, the
program will stop with the error message "Reading past end of data".
20. When reading information from a file, you must refer to the
file by its file number.
21. A program can read only the first line of a text file, but
not the last line or only the third line.
22. The correct statement is OPEN #3: name "VALUES".
23. The correct statement is LINE INPUT #2: Line$.
24. (a) The first asterisk is displayed in column 1.
(b) The second asterisk is displayed in column 16.
25. The statement "SET zonewidth 10" changes the current
zone width to 10 columns.
26. A trailing semicolon after a PRINT statement suppresses
the normal carriage return and line feed, holding the cursor at the
end of the displayed line.
27. (a) When Number has a value of 17.2, the display is 17.20.
(b) When Number has a value of -17.2, the display is *****.