Download Print this page

VTech PreComputer 2000 Manual page 21

Advertisement

BASIC COMPUTER TUTORIAL
1. A REAL SMALL PROGRAM.
You and Taraesa went to the local video store to rent
_
some movies. Taraesa
brought back 12 but 4 were too gory for you and so you took them back. On
that trip you carried away and came home with 7 new ones. How many are you
going to watch this afternoon? You could work this out yourself but here is a small
BASIC program that can do the arithmetic for you.
Type In:
10
PRINT
12-4+7
20
END
and press ENTER
and press ENTER
Not much to it. Now type RUN and press ENTER
.
What happens? The answer,
15,
appears on the display.
In BASIC, you write a series of line-numbered statements that tell the
PRECOMPUTER 2000 what to
do.
The first
statement,
numbered 10, tells the
computer to work out the sum of three numbers and then PRINT the answer in
the display. 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, then type RUN and press
ENTER. What happens? That's right, you get the same results.
Suppose you typed:
I
10 PRONG 12-4+7
and 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 PRECOMPUTER 2000's way of telling you
this.
You
need to EDIT the line or re-type it, changing the "PRONG" word to "PRINT" and
then RUN the program to get the correct
answer.
You can use PRECOMPUTER 2000 as a calculator in arithmetic statements like
the one above by not using a line
number.
Just type:
I
PRINT 12-4+7
and press ENTER
The answer will appear on the display.
20

Advertisement

loading
Need help?

Need help?

Do you have a question about the PreComputer 2000 and is the answer not in the manual?