Answer:

The program will print out:

The value is:   17

Adding to the number in a Variable

In executing the statement

LET VALUE = 12 + EXTRA

the following things happened:

  1. Memory was found for VALUE since it has not been used before.
    • No memory was found for EXTRA since it has already been used to save the number 5.
  2. The calculation on the RIGHT of the equal sign was done: 12 + EXTRA.
    • The variable EXTRA contains the number 5.
    • The sum 12 + 5 is performed resulting in 17.
  3. The variable on the LEFT of the equal sign, VALUE, is used to save the 17.

QUESTION 7:

What will the following program print out:

' Example LET statements
LET VALUE = 5
LET VALUE = 12 + VALUE
PRINT "The value is:", VALUE
END

(Hint: the second LET might look odd, but it is OK. Follow the same three steps as in the previous paragraph.)