P. 13
Of course, you may not want to change line 10 each time you
want to give the Computer a value of A. Let's introduce another
BASIC statement: INPUT. Add the following lines:
5 PRINT "THE VALUE I WISH TO GIVE A IS"
10 INPUT A
RUN the program. The screen will show:
THE VALUE I WISH TO GIVE A IS
?
The Computer is asking you to give it a value for A. Type a
number and ENTER it. See what happens now. Try other numbers.
Now change line 5 as follows :
5 INPUT "THE VALUE I WISH TO GIVE A IS";A
Delete line 10 (type a line 10 and ENTER it with nothing else).
Run the program now and see what happens :
THE VALUE I WISH TO GIVE A IS?_
Type a number; ENTER it and see if the program works the same.
You made a number of changes with lines 5 and 10:
A. Changed PRINT to INPUT.
B. Changed A to be on the same line as the printing info.
C. Eliminated one line.
This illustrates one of the ways you can shorten a program.
(We'll have lots more on this in the final version of the
User's M a n u a l .)