Download Print this page

VTech PreComputer 2000 Manual page 27

Advertisement

The statement at line
1 O
stores the numeric constant zero into N, a numeric
variable. In statement
20
the variable
will have a numeric constant, 1, added
to itself and then the sum of that operation will be stored in place of the value
previously stored
there.
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 in 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 1 O 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$
26

Advertisement

loading
Need help?

Need help?

Do you have a question about the PreComputer 2000 and is the answer not in the manual?

Subscribe to Our Youtube Channel