Radio Shack TRS-80 User Manual page 23

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

Advertisement

THE
DISTANCE
IS
3000 MILES.
Look
carefully
at
program
line
50.
There's
no
unused
space
between
the
S
in
IS
,
the
D
,
and
the
M
in
MI
LES
.
But
in
the printout
on
the display, there
is
a space
between IS and
30
00
,
and
another
space
between
300
and
MILES.
How
come?
Reason:
A
semicolon automatically
inserts
one
space
between
the
two
items
it
is
separating.
As you
do more
programming,
this
point
will
become
important.
WHEW!
Well,
we
have
already
covered
more
than
enough commands,
statements
and math
operators
to
solve
myriads
of problems.
Now
let's
spend
some
time
actually writing
programs
to
solve
problems.
There
is
no
better
way
to learn
than
by
doing,
and
everything covered so
far
is
fundamental
to
our
success
in later
Chapters.
So
don't
jump
over these
exercises
-
it's
the best
way
to get
you
into the
thick of
programming.
You'll find
sample answers
in
Part
B, along
with
further
comments.
Math
operators?
they're
the-,
symbols
;we
talked
about
earlier.
.:-
-;
:
-;;
:,.-•...
'):-::.;
':•>•:
EXERCISE
3-2:
Write
a
program which
will
find
the
time
required to
travel
by
jet
plane
from San Diego
to
Boston,
if
the distance
is
3000
miles
and
the plane
travels at
500
MPH.
EXERCISE
3-3;
If
the
circumference of
a
circle
is
found by
multiplying
its
diameter times
it,
(3.14) write
a
program which
will
find the
circumference of a
circle
with
a
diameter of
35
feet.
21

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents