EasyManua.ls Logo

Radio Shack TRS-80 - Page 37

Radio Shack TRS-80
236 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
We'll
answer
that question
by
upgrading
our Celsius-to
-Fahrenheit
conversion
program
(Chapter
5).
If
you think GOTO is
a powerful statement
in everyday
life,
wait till
you
see
what it does for a computer
program!
Type
NEW
and the following:
10
REM
*
IMPROVED
CELSIUS TO
FAHRENHEIT
CONVERSION
PROGRAM
*
20
INPUT
"WHAT
IS THE TEMPERATURE
IN
DEGREES
CELSIUS"
;C
30 F
=
(9/5)*C
+
32
40
PRINT
C; " DEGREES
CEL S
I
US
=
";F[
" DEGREES
FAHRENHE
I
T
.
"
50 GOTO 20
and RUN .
The
Computer will keep
on
asking for
more
until you
get
tired or the
power
goes off (or
some
other event beyond
its
control).
This
is the kind
of thing a
Computer is
best at
doing
something over
and
over again.
Modify
some of
the
other
programs
to make
them self-
repeating.
You'll find
they're
much
more
useful that
way.
These have
been
7
long and "meaty"
lessons,
so
go back and
review them all
again,
repeat-
ing those
assignments where
you feel weak.
We are moving
out
into
progressively
deeper
water,
and it is complete
mastery of these
fundamentals
that is your life
preserver.
Learned in
Chapter
7
Statements
INPUT
and
INPUT
with
built-in PRINT
"''-
':'.',"','.,
Miscellaneous
;
Trailing
semicolon
Twill have
to hit
1
BREAK)
to
get
ottt
of
the
program
loop.
ft!
K
i
I
"
I
CAN DO
THIS
Alt
DAY
"
35

Other manuals for Radio Shack TRS-80

Related product manuals