VTech Power Pad Precomputer Power Pad Plus User Manual page 45

Vtech precomputer power pad plus user's manual
Table of Contents

Advertisement

You can use as many input statements as you need to get all the values into your program.
Try this:
NEW
10
INPUT "GIVE ME A NUMBER"; N1
20
INPUT "AND ANOTHER"; N2
30
PRINT "I WILL ADD THEM"
40
C=N1+N2
50
PRINT "THE ANSWER IS"; C
Type RUN and press ENTER to see what happens.
MAKING DECISIONS
The IF statement tells the computer that it has to make a decision. It does this by comparing
two numbers, or arithmetic expressions or string variables. It uses special symbols to represent
a condition.
The symbol > means greater than.
The symbol < means less than.
The symbol = means equal to.
The symbol > = means greater than or equal to.
The symbol < = means less than or equal to.
Here are some conditions:
5 < 10
They are both true because
5 is less than 10
20 is greater than 10
The IF statement has a condition either TRUE or FALSE. The computer evaluates the
condition and decides that if a condition is TRUE it will do something for the TRUE condition.
Take the following:
IF A > 90 THEN PRINT "YOU ARE SMART"
20 > 10
press ENTER
press ENTER
press ENTER
press ENTER
press ENTER
41

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents