EasyManua.ls Logo

Radio Shack TRS-80 - Page 60

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...
EXERCISE
11-4: Here's
an old
chestnut
that
the Computer
really
eats up: Design, write
and
run a
program
which
tells how
many days
you
have to work,
starting
at
a
penny a
day,
so if your
salary
doubles
each day
you
know which day
you earn at least a
million
dollars.
Include
columns
which
show each day
number, its
daily
rate, and the
total
income
to-date.
Make the
program stop
after printing the
first day
your
daily rate is a million
dollars or
more.
The "Brute Force"
Method
(Subtitled: Get a
Bigger Hammer)
Much to
the
consternation of
some teachers, a
great value of the
Computer is its
ability
to
do the
tedious work
involved
in the "cut and
try",
"hunt and peck"
or
other less respect-
able
methods
of
finding an answer
(or
attempting to prove
the
correctness of a
theory,
theorem or
principle). This method
involves
trying
a
mess of possible
solutions
to
see if one
fits, or find
the
closest one, or establish a trend.
Beyond that,
it can be a powerful
learning
tool by
providing
gobs of data in chart
or
graph form (later) which would simply take too
long to
generate by hand.
EXERCISE
11-5:
You
have a
1000
foot
roll of
fencing
wire and want to
create
a
rectangular
pasture.
Using all of
the
wire, determine
what
length and
width
dimensions
will allow you
to
enclose
the
maximum
number of
square feet?
Use
the brute
force method; let the
Computer try
different
values for L and W
and print out
the Area fenced by
each pair of L and
W.
The formula for
area
is Area
=
Length
times Width
or A
=
L
*
W
EXERCISE 1
1-6:
EXTRA CREDIT
PROBLEM FOR
"ELECTRONICS
TYPES"
As a
furtner
example
(more complex
and
tends to
prove
the point better) try
this final
(optional)
assignment
in
this
lesson. It
involves
a
problem
confronted by every
electricity
student
who has
studied sources
(batteries,
generators)
and loads
(lights,
resistors). It is the
MAXIMUM
D.C.
POWER
TRANSFER
THEOREM
which states, "Maximum DC
power is
delivered to
an
electrical
load
when the
resistance
of that
load
is equal in value to
the
internal resistance
of
the source."
And
then the
arguments begin
. . .
"Use
a
high resistance
load
because it
will drop
more
voltage
and accept
more
power."
"No,
use a
low
resistance
load
so
it
will draw more
current and accept
more power".
"Use
a load which is
somewhere
in between."
58

Other manuals for Radio Shack TRS-80

Related product manuals