EasyManua.ls Logo

Radio Shack TRS-80 - Page 181

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
ANSWER
FOR EXERCISE
3-3:
10 REM
*
CIRCUMFERENCE SOLUTION
*
20 P
=
3.14
30 D
=
35
40
C
=
P
*
D
50
PRINT
"THE
CIRCLE'S
CIRCUMFERENCE
IS";C; "FEET."
SAMPLE RUN
FOR
3-3
THE
CIRCLE'S
CIRCUMFERENCE
IS
109.9
FEET.
Note:
Since n is not included in Radio Shack's
LEVEL
I BASIC, we
have
to
set a variable (in this case P was used) equal to the value of pi
(3.14)
SAMPLE ANSWER
FOR
EXERCISE 34:
10
REM
*
CIRCULAR
AREA
SOLUTION
*
20 P
=
3.14
30
R
=
5
40A=P*R*R
50
PRINT
"THE CIRCLE'S
AREA
IS'*;A;
"
SQUARE
I NCHES
.
"
SAMPLE RUN FOR
34
THE CIRCLE'S AREA
IS
78.5
INCHES.
Note: The LEVEL I BASIC
system does not
have a function which
means
"raise
to the power" to
handle
R
2
.
(LEVEL II BASIC does.)
In easy cases like this one,
we
can
simply use
R
times
R (R*R).
If
you
have
a LEVEL II
system, you'll learn how
to
use the simple EXPO-
NENTIATION function
in
the
USER'S MANUAL
for LEVEL II.
179

Other manuals for Radio Shack TRS-80

Related product manuals