Vtech PreComputer Power Pad Plus User Manual - Page 46

Print Type In The First Letter Of

Page 46 highlights

The A > 90 is a condition. The print "YOU ARE SMART" is the command given for the true condition. In the above example, let's give A the value 80. Would the message be printed? No, it would not be printed because the condition is false (80 is less than 90). Let's try a program to compute the area of a rectangle. Type: NEW 10 INPUT "ENTER THE LENGTH";L press ENTER 20 INPUT "ENTER WIDTH";W press ENTER 30 LET A=L*W press ENTER 40 PRINT "THE AREA IS";A press ENTER 50 INPUT "ANOTHER? (Y/N)";R$ press ENTER 60 IF R$="Y" THEN 10 press ENTER 70 PRINT "THAT'S ALL FOLKS!" press ENTER 80 END RUN This program uses the INPUT statement to get values for numeric variables and prints a computed result. It then prompts for a string variable and makes the decision to begin again if the value typed in is a Y. Here's another one. Type: NEW 10 INPUT "GIVE ME A NUMBER";A 20 INPUT "AND ANOTHER";B 30 PRINT "ADD, SUBTRACT, MULTIPLY OR DIVIDE" 40 PRINT "TYPE IN THE FIRST LETTER OF THE" 42

  • 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

42
The A > 90 is a condition.
The print “YOU ARE SMART” is the command given for the
true condition.
In the above example, let’s give A the value 80.
Would the message be
printed?
No, it would not be printed because the condition is false (80 is less than 90).
Let’s try a program to compute the area of a rectangle.
Type
:
NEW
10
INPUT “ENTER THE LENGTH”;L
press
ENTER
20
INPUT “ENTER WIDTH”;W
press
ENTER
30
LET A=L*W
press
ENTER
40
PRINT “THE AREA IS”;A
press
ENTER
50
INPUT “ANOTHER? (Y/N)”;R$
press
ENTER
60
IF R$=“Y” THEN 10
press
ENTER
70
PRINT “THAT’S ALL FOLKS!”
press
ENTER
80
END
RUN
This program uses the
INPUT
statement to get values for numeric variables and prints
a computed result.
It then prompts for a string variable and makes the decision to begin
again if the value typed in is a Y.
Here’s another one.
Type
:
NEW
10
INPUT “GIVE ME A NUMBER”;A
20
INPUT “AND ANOTHER”;B
30
PRINT “ADD, SUBTRACT, MULTIPLY OR DIVIDE”
40
PRINT “TYPE IN THE FIRST LETTER OF THE”