Answer:

2    4     3

Example Explained

Here (again) is what a LET statement does:

  1. Finds memory for each new variable in the statement. A zero will be placed in numeric variables if there is no other information. (If there are no new variables, this step does nothing.)
  2. Does the calculation on the right of the equal sign. (If there is nothing to calculate, it just uses the value that is there.)
  3. Replaces the contents of the variable to the left of the equal sign with the result of the calculation.

Here (again) is the example program:

' LET example
LET A = 2
LET B = 4
LET C = (A + B) / 2
PRINT A, B, C
END

The first statement:

  1. Finds memory for A.
  2. Uses the value 2.
  3. Stores the 2 in A.

The second statement:

  1. Finds memory for B.
  2. Uses the value 4.
  3. Stores the 4 in B.

The third statement:

  1. Finds memory for C. (A and B need no new memory.)
  2. Does the calculation: (A + B) / 2
  3. Stores the result 3 in C.

Finally the PRINT looks in each of A, B, C and writes out the contents.

QUESTION 25:

Say that the first time a variable appears in a program is on the RIGHT side of an = sign in a LET statement. Is this a bug?