Vtech PreComputer Power Pad Plus User Manual - Page 45

Input Give Me A Number; N1, Input And Another; N2, Print I Will Add Them, C=n1+n2, Print

Page 45 highlights

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 press ENTER press ENTER press ENTER press ENTER press ENTER 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 20 > 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" 41

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88

41
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
press
ENTER
20
INPUT “AND ANOTHER”; N2
press
ENTER
30
PRINT “I WILL ADD THEM”
press
ENTER
40
C=N1+N2
press
ENTER
50
PRINT “THE ANSWER IS”; C
press
ENTER
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
20 > 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”