Radio Shack TRS-80 User Manual page 194

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

Advertisement

SAMPLE ANSWER FOR
EXERCISE
14-3:
This
was
almost too
easy.
55
A
=
INK
100
*A)/I00
SAMPLE ANSWER
FOR
EXERCISE
1
4A:
Oh
Pshaw!
And
it
seemed
so
easy.
You
should have
entered:
55
A =
INK
1000
*A)/1000
Oh, you
did?
And
you
got
3
answers, then
it
crashed, saying:
HOW?
55
A =
INK
1000
*
A)?/1000
It
is
all
correct.
Then
why
doesn't
it
work?
Well,
if
you
have
LEVEL
II
BASIC
it
did
work.
If
you
can't figure
out
why
it
didn't
work
with
LEVEL
I
and
you
don't
know
why, you
forgot to read the
NOTE
at
the beginning
of
the
lesson.
Go
back and
read
it.
OK.
32727
is
the
largest
permissible
number
inside
the brackets of
INT(A).
When
the pro-
gram
tried
to
execute the fourth
pass
of the loop,
it
hit
INT(1000
* 5(3.2654) etc.
which
becomes
INT(5(3265.4)
which
is,
of course,
too
big.
So
the
Computer
said
HOW?
But
wait
there
is
a
way
to get
the desired
result.
Try
55A
=
INT(A)
+
INK
{
A-
INK
A)
)
*
1000/1 000
SAMPLE ANSWER
FOR
EXERCISE
15-1:
10
INPUT
"
TYPE ANY NUMBER
20
REM
*
SGN
ROUTINE
*
22
IF
X
<0
THEN
T = -1
24
IF X =
THEN
T =
192
;X
Remember:
Just
becauseLEVELl'BASie'can't
solve
a problem one
way
doesn't
mean
it
can't be,
done.
You've
jasi
got
to
be
a
little
fancier,
sneakier.
.
.or
whatever.
And
that's
half the fun,
of programming!-:
*
.
:
'."'
;'.;"! :^;A
r:
."^:V*"':-'':""V
--riV;"-"
:'
-
:
'-.-.:..:
.:
"
v.
.-.'

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents