EasyManua.ls Logo

HP 48GII

HP 48GII
653 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...
RPL Programming 1-5
Example: Enter a program SPH that calculates the volume of a spherical cap of height h within a sphere of
radius R using values stored in variables H and R.
V
1
3
---
πh
2
3rh()=
In this and following chapters on programming, “stack diagrams” show what arguments must be on the stack
before a program is executed and what results the program leaves on the stack. Here's the stack diagram for
SPH.
Level 1
"
Level 1
"
volume
The diagram indicates that SPH takes no arguments from the stack and returns the volume of the spherical cap
to level 1. (SPH assumes that you've stored the numerical value for the radius in variable R and the numerical
value for the height in variable H. These are global variables — they exist outside the program.)
Program listings are shown with program steps in the left column and associated comments in the right column.
Remember, you can either press the command keys or type in the command names to key in the program. In this
first listing, the keystrokes are also shown.
Program: Keys: Comments:
«
@%
Begins the program.
'1/3
O1 /3
Begins the algebraic expression
to calculate the volume.
*œ*H^2
*!ì
*H Q2
Multiplies by
π
h
2
.
*(3*R-H)'
*!Ü
3 * R -
H ™™
Multiplies by 3r - h, completing
the calculation and ending the
expression.
NUM
Converts the expression with π to
a number.
»
`
OSPH K
Ends the program.
Puts the program on the stack.
Stores the program in variable
SPH.

Table of Contents

Other manuals for HP 48GII

Related product manuals