EasyManua.ls Logo

HP HP-32S - Simple Programming

HP HP-32S
312 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...
5
Simple
Programming
Part
1of
this
manual
introduced
you
to
functions
and
operations
that
you
can use
manually,
that is, by
pressing
a key for each individual
operation. A
program
lets you repeat operations or calculations with
out
repeating
the
keystrokes.
In this
chapter
you
will learn how to
program
a
series
of
operations
to
occur
automatically.
In the
next
chapter,
'Programming
Techniques,'
you
willlearn
about
subroutines
and
conditional
instructions.
Introduction: A Simple Programming Example.
To
find the area
of a
circle
with a radiusof 5, you
would
use the
formula
A = tt2 and
press
5
IS
10
0
to get
the
result for this circle, 78.5398.
But
what if
you
wanted to find the area of
many
different
circles?
Rather
than
repeat
the
given
keystrokes
each
time
(varying
only
the
*5'
for
the
different
radii),
you
can
putthe
repeatable
keystrokes
into
a
program:
001
*2
002
tr
003
x
This very simple program assumes that the value for the radius is in
the
X-register
(the
display)
when the
program
starts to run. It
com
putes the area and
leaves
it in the
X-regjster.
70
5:
Simple
Programming

Table of Contents

Related product manuals