Vtech PreComputer Power Pad Plus User Manual - Page 49

Print N Is;n, N=n+1, If N > 10 Then End, Goto 20, For N=1 To 10 Step 2, Next N, For N=10 To 1

Page 49 highlights

We could always rewrite the program like this: 10 N=1 20 PRINT "N IS";N 30 N=N+1 40 IF N > 10 THEN END 50 GOTO 20 We can also count by 2's. Let's bring back the previous program and change line 10. The entire program looks like this: NEW 10 FOR N=1 TO 10 STEP 2 20 PRINT "N IS";N 30 NEXT N press ENTER press ENTER press ENTER The STEP 2 part changes the meaning hidden in the NEXT N statement to be N = N + 2 or any other number that gets put in the STEP part. We can even count backwards. Try this: NEW 10 FOR N=10 TO 1 STEP -1 20 PRINT N 30 NEXT N 40 PRINT "BLAST OFF" RUN 45

  • 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

45
We could always rewrite the program like this
:
10
N=1
20
PRINT “N IS”;N
30
N=N+1
40
IF N > 10 THEN END
50
GOTO 20
We can also count by 2’s.
Let’s bring back the previous program and change line 10.
The entire program looks like this:
NEW
10
FOR N=1 TO 10 STEP 2
press
ENTER
20
PRINT “N IS”;N
press
ENTER
30
NEXT N
press
ENTER
The
STEP
2 part changes the meaning hidden in the
NEXT
N statement to be N = N
+ 2 or any other number that gets put in the
STEP
part.
We can even count backwards.
Try this
:
NEW
10
FOR N=10 TO 1 STEP -1
20
PRINT N
30
NEXT N
40
PRINT “BLAST OFF”
RUN