Vtech PreComputer Power Pad Plus User Manual - Page 65

Input A,b,c, If A=b And B=c Then Print A=b=c, If Not A=b Or Not B=c Then 50, Print A=b=c Is False

Page 65 highlights

Note that T = TRUE and F = FALSE. Example: 10 INPUT A,B,C 20 IF A=B AND B=C THEN PRINT "A=B=C" 30 IF (NOT A=B) OR (NOT B=C) THEN 50 40 END 50 PRINT "A=B=C IS FALSE" 60 END RUN ? 10 (pick a number) ?? 5 (pick a number) ?? 7 (pick a number) A=B=C IS FALSE Moreover AND, OR, and NOT can be used to manipulate numerical values. These operations are based on binary numbers with 1 and 0 representing TRUE and FALSE respectively. For example: NOT 1=-2 [1=binary 00000001 and -2=binary 11111110, so it just changes the 1 to 0 and 0 to 1. In other words, TRUE(1) changed to FALSE(0) and FALSE(0) changed to TRUE(1).] OR 13=15 [6=binary 00000110 and 13=binary 00001101, so, with reference to the OR truth table, 6 OR 13 =15=binary 00001111] AND 13=4 [6=binary 00000110 and 13=binary 00001101, so with reference to the AND truth table, 6 AND 13=4 binary 00000100] INPUT Line # INPUT "(optional character string)"; variable 1, variable 2,.... INPUT allows the user to type in the value of a variable at the time the program is RUN. If an optional character string is used, this message will be printed before the question is asked. The type of data to be INPUT varies according to the type of the variable. 61

  • 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

61
Note that T = TRUE and F = FALSE.
Example:
10
INPUT A,B,C
20
IF A=B AND B=C THEN PRINT “A=B=C”
30
IF (NOT A=B) OR (NOT B=C) THEN 50
40
END
50
PRINT “A=B=C IS FALSE”
60
END
RUN
? 10
(pick a number)
?? 5
(pick a number)
?? 7
(pick a number)
A=B=C IS FALSE
Moreover
AND
,
OR
, and
NOT
can be used to manipulate numerical values.
These operations
are based on binary numbers with 1 and 0 representing
TRUE
and
FALSE
respectively.
For example:
NOT 1=-2 [1=binary 00000001 and -2=binary 11111110, so it just changes the 1 to 0 and
0 to 1.
In other words, TRUE(1) changed to FALSE(0) and FALSE(0) changed to TRUE(1).]
OR 13=15 [6=binary 00000110 and 13=binary 00001101, so, with reference to the OR truth
table, 6 OR 13 =15=binary 00001111]
AND 13=4 [6=binary 00000110 and 13=binary 00001101, so with reference to the AND truth
table, 6 AND 13=4 binary 00000100]
INPUT
Line #
INPUT
“(optional character string)”; variable 1, variable 2,
....
INPUT
allows the user to type in the value of a variable at the time the program is
RUN
.
If an optional character string is used, this message will be printed before the question
is asked.
The type of data to be
INPUT
varies according to the type of the variable.