Answer:

Program with a String Variable

Here is a program that uses a string variable.

LET NAME$ = "Sherlock Holmes"
PRINT NAME$
END

When this program is run the following happens:

  1. Execution starts with the first statement:
    • Since the variable NAME$ has not been seen before, the system finds memory for it.
    • The variable starts out empty—there are no characters stored in it.
    • Now the characters from right of the = are copied into the variable.
    • (The quote marks "" are not copied since they are not part of the string.)
  2. Execution continues with the second statement:
    • The characters stored in memory in the variable NAME$ are printed out.

The following will appear on the monitor screen:

Sherlock Holmes

QUESTION 3:

Here is a slightly different program:

LET NAME$ = Sherlock Holmes
PRINT NAME$
END

What do you think will happen with this new program? (Hint: this is a trick question.)