Answer:

The program will print out:

Value is:            5
Now the value is:   15

Notice that VALUE is used in the first PRINT statement, then the number stored in VALUE is changed by adding 10 to it, then the second PRINT statement prints the new number.

' More example LET statements
LET VALUE = 5
PRINT "Value is:", VALUE
'
LET VALUE = VALUE + 10
PRINT "Now the value is:", VALUE
END

A Sequence that Counts

Look at the following program:

' Counting up

LET COUNT = 0          'Statement 1

PRINT COUNT            'Statement 2
LET COUNT = COUNT + 1  'Statement 3

PRINT COUNT            'Statement 4

END
  1. Statement 1 finds memory for COUNT and puts 0 into it.
  2. Statement 2 prints out the 0 in COUNT.
  3. Statement 3 first gets the 0 from COUNT, adds 1 to it, and puts the result back in COUNT.
  4. Statement 4 prints out the 1 that is now in COUNT.
  5. The program ends.

When the program runs it prints:

0
1

QUESTION 9:

Think of a way to print 0, 1, and 2 on the monitor.