EasyManua.ls Logo

HP HP-28S - BOXR (Ratio of Surface to Volume of a Box)

HP HP-28S
341 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...
BOXR (Ratio of
Surface
to
Volume of a Box)
Given
the
height,
width,
and
length
of
a box, calculate
the
ratio
of its
surface to its volume.
Arguments
Results
3:
height
3:
.~.
,
width
2:
'""
.
1 :
length 1 :
area/volume
Techniques:
Nested
user
functions. BOXR is a
user
function
whose
defining
ex-
pression uses BOXS in its calculation. In
turn,
BOXR
could
be
used
to
define
other
user
functions.
Recall
that
BOXS
was
defined
using
h,
w,
and
I as local variables,
and
note
below
that
BOXS takes
x,
y,
and
z as
arguments
in
the
definition for BOXR.
It
makes
no
difference if
the
local variables in
the
two definitions
match,
or
if
they
don't
match,
because
each
set
of
local variables is
independent
of
the
other. However, it's essential
that
local variables
be
consistent
within
a single definition.
Program
"*
::<
1;:1
Z
,
80::-(:3
(::<
..
'::I
..
z::O
. / (::<l'::Ilz::O '
[ENTER
[
o BOXR
[STO[
Comments
Begin
the
program.
Create
local variables for height,
width,
and
length. This
program
uses
x,
y,
and
z,
rather
than
h,
w,
and
l.
Begin
the
defining
expression
with
the
user
function
BOXS.
Divide
by
the
volume
of
the
box .
End
the
program.
Put
the
program
on
the
stack.
Store
the
program
as BOXR.
28:
Programming
Examples
245

Table of Contents

Other manuals for HP HP-28S

Related product manuals