EasyManua.ls Logo

Radio Shack TRS-80 - Page 183

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...
SAMPLE
RUN
FOR
4-2:
THE
TOTAL
NUMBER
OF MILES
DRIVEN
IS 1E+10
Note:
The answer came
out
exactly the same as
before,
meaning
we
not
only
receive
answers in SSN,
but
can also use it
in
our
programs.
SAMPLE ANSWER TO
EXERCISE
5-1
:
10 REM
*
FAHRENHEIT TO CELSIUS
CONVERSION
*
20 F
=
65
30 C
=
(F
-
32)
*
(5/9
)
40 PRINT Fj
"DEGREES
FAHRENHEIT
="
;C ;
"DEGREES CELSIUS."
SAMPLE
RUN
FOR
5-1:
65 DEGREES FAHRENHEIT
=
18.3333
DEGREES
CELSIUS.
Observe
carefully how the
parentheses were
placed. As a
general
rule,
when in
doubt
use
parentheses.
The worst they
can do is slow down
calculating
the
answer by a few
millionths of a second.
SAMPLE
ANSWER TO
EXERCISE
5-2:
30 C
=
F-32
*
(5/9)
SAMPLE
RUN
FOR
5-2:
65
DEGREES
FAHRENHEIT
=
47.222
DEGREES
CELSIUS.
Note how
silently and
dutifully the
computer
came
up with the
WRONG
answer. It has done
as
we directed, and
we directed
it
wrong.
A
common
phrase in
computer
circles is GIGO
(pronounced
"gee-joe").
It stands
for "Garbage
In
Garbage Out".
We
have given
the
computer
garbage and it
gave it
back to us by
way
of
a wrong
answer.
Phrased
another way, "Never in
the history of mankind
has there been
a machine
capable of
making so many
mistakes
so rapidly and
confi-
dently." A
computer is
worthless
unless it is
programmed
correctly.
m
181

Other manuals for Radio Shack TRS-80

Related product manuals