VTech E Power User Manual Page 38

  • Download
  • Add to my manuals
  • Print
  • Page
    / 88
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 37
34
BASIC COMPUTER TUTORIAL
EXAMPLE OF A BASIC PROGRAM
You and Teresa went to the local video store to rent some movies. Teresa brought back
12 but 4 were too scary for you so you returned them. On that trip you came home with
7 new movies. How many are you going to watch this afternoon? You could work this
out yourself, but here is a BASIC program that can do the arithmetic for you.
Type in:
10 PRINT 12-4+7 press ENTER
20 END press ENTER
Now type RUN and press ENTER. What happens? The answer, 15, appears on the screen.
In BASIC, you write a series of line-numbered statements that tell the PRECOMPUTER
POWER PAD™ PLUS what to do. The first statement, numbered 10, tells the computer
to work out the sum of three numbers and then PRINT the answer on the screen. The
next statement, number 20, tells the computer that this is the end of the program and that
it can stop RUNNING. However, the last statement is not necessary in this program because
you only want to print out the sum of 3 numbers, therefore, it could be removed.
Remove that last line by typing 20 and press ENTER. Now type RUN and press ENTER. What
happens? You get the same results.
Suppose you typed:
10 PRONG 12-4+7 press ENTER
Now type RUN and press ENTER. What happens? You get a strange message, ? SYNTAX
ERROR IN 10 in the display. That means you made a mistake in BASIC grammar and
this is the PRECOMPUTER POWER PAD™ PLUS unit’s way of telling you this. You need
to EDIT the line or re-type it, changing “PRONG” to “PRINT” and then RUN the program
again to get the correct answer.
You can use PRECOMPUTER POWER PAD™ PLUS as a calculator in arithmetic statements
like the one above by not using a line number.
Just type:
PRINT 12-4+7 press ENTER
The answer will appear on the screen.
Another short cut is that you could use the “?symbol to stand for the word “PRINT.” When
you are using BASIC as a calculator in “command mode”, think of the question mark as
meaning “What is 12-4+7?” When you are using the question mark as a “PRINT” command
in a program, the computer will replace the “?” with the word “PRINT” for you.
Page view 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 87 88

Comments to this Manuals

No comments