Radio Shack TRS-80 User Manual page 21

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

Type
in
the following:
10
REM
*
DISTANCE,
RATE, TIME
PROBLEM
*E2Q33
(this
sure
is
a
slow computer).
20
R
=
500
30
T =
6
mm
to
D = r
*
t
Gzoia
Check
the
program
carefully,
then
run
ESE3
Hum
de
dum
ho-hum
READY
All
it
says
is
READY
.
The Computer
doesn
't
work!
Yes
it
does.
It
worked
just
fine.
The Computer
multiplied
500
times
6
just
like
we
told
it,
and came up
with
the
answer
of
3000
miles.
But
we
forgot to
tell
it
to
give
us
the
answer.
Sorry
about
that.
Can you
finish this
program without
help?
It
only
takes
one
more
line.
Give
it
a
good
try
before reading
on
for
the answer.
That way,
the
answer
will
mean more
to
you.
(Hint:
We've
already used
PRINT
to print
messages
in
quotes.
What would
happen
if
we
said
50
PRINT
M
D
"?..
.
No,
we
want
the
value of
D, not
"D"
itself.
Hmmm,
what happens
when we
get
rid
of the quotes?)
RKED
ON.
THE
MOVE
1
:
J
.^
-:>:?-
<
vj
-
"
*"
"
DON'T
RE0
BEYOND;
}&AJZ'KL-Jiih,'
saw
Look
in
Part
B
of
this
Manual
for
an
answer
for
this
1st
Exercise.
Also
some
notes
and
ideas.
Well,
the
answer
of
3000
is
correct,
but
its
"presentation"
was no
more
inspiring
than the
printout
from
a
hand
calculator.
This
inevitably leads us
back
to
where
we
first
started
this
foray
into
the
unknown
the
PRINT
statement.
Note
that
we
said
in line
50
PRINT
D.
There were no quotes around
the
letter
D
like
we
had
used
before.
The
reason
is
simple but
fairly
profound.
If
we want
the
Computer
to
print
the
exact
words
we
specify,
we
enclose
them
in
quotes.
If
we
want
it
to print
the value
of a
variable, in this
case
D,
we
leave
the quotes
off.
That
simple
message
is
worth
serious
thought
before continuing on.
Yes,
yet
.
.
.we
know:
the 'distance
from
Bos$qb
to
Saa Diego
isefoser to
2§0y-r»H#$
'—
But
we
took
)
a
<juick
detour
via
Bermuda
(besides,
3000
is
an
easiet^umbwtobe
*orkh^with)?
Md
you
think seriously
aBout
it?!
you
go!
,
Then
oti
19

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents