User Guide

40
The program in the above example contains a programming construction called a loop. A
loop is one or more BASIC statements, usually called a set, that can be executed as many
times as you want. The statement in line 40 contains an IF statement. It is called a
conditional statement and will be discussed in detail under the topic called Making Decisions.
6. INPUTTING DATA
We have been putting information into the computer by typing constants into programs using
statements like the following:
10 LET N=10
20 LET A4$="NANCY LIKES CHOCOLATE CUPCAKES"
Another way to supply data is by using an INPUT statement.
Try this out by typing:
NEW
10 INPUT "GIVE ME A NUMBER"; N
20 PRINT "YOUR NUMBER IS"; N
The computer will print the literal following the INPUT command in line 10 on the display.
It will prompt you for a number with the character. You can type any number of digits
that you like and press Enter to let the computer know you have finished. Ready? Try
it, type: RUN and press Enter.
You can also input alphabetic data into string variables like this program:
10 INPUT "WHAT IS YOUR NAME"; N$
20 PRINT "HI THERE "; N$
You can use as many input statements as you need to get all the values into your program.