VTech Precomputer Power Pad Plus User Manual

Page 44

Advertising
background image

40

50

PRINT “THE ANSWER IS”; N press ENTER

RUN

The statement at line 10 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
.

INPUTTING DATA

We have been putting information into the computer by typing constants into programs using
statements like the following:

10

LET N=10

press ENTER

20

LET A$=“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 press ENTER

20

PRINT “YOUR NUMBER IS”; N

press ENTER

RUN

The unit will prompt you to input a number with the character. Type any number of digits
that you like and press ENTER.

You can also input alphabetic data into string variables like this program:

10

INPUT “WHAT IS YOUR NAME”; N$

press ENTER

20

PRINT “HI THERE”; N$

Advertising