EasyManua.ls Logo

HP HP-28S - Median of Statistics Data

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...
Median
of
Statistics
Data
This section contains three programs:
SORT orders the elements of a list.
LMED calculates
the
median
of a sorted list.
MEDIAN uses SORT
and
LMED to calculate the
median
of the cur-
rent
statistics data.
SORT (Sort a List)
Sort a list into ascending order.
Arguments
Results
1 :
{
list
}
1 :
{
sorted list
}
Techniques:
Bubble sort. Starting
with
the
first
and
second
numbers
in
the
list,
SORT compares adjacent
numbers
and
moves the larger
number
toward
the
end
of
the
list. This process is
done
once to move
the
largest
number
to the last position in list,
then
again to
move
the
next largest to
the
next-to-Iast position,
and
so on.
Nested definite loops. The
outer
loop controls the stopping position
each time
the
process is done;
the
inner loop
runs
from 1 to the
stopping position each time the process is done.
Nested local-variable structures. SORT contains two local-variable
structures, the second inside the defining program of
the
first. This
nesting is
done
for convenience; it's easier to create
the
first local
variable as soon as its value is computed, thereby removing its
value from
the
stack, rather
than
computing
both
values
and
creat-
ing
both
local variables
at
once.
270
28:
Programming
Examples

Table of Contents

Other manuals for HP HP-28S

Related product manuals