Boxs Without Local Variables - HP -28S Manual

Advanced scientific calculator
Hide thumbs Also See for HP-28S:
Table of Contents

Advertisement

BOXS Without Local Variables
The following program uses only stack operations to calculate the sur-
face of a box. Compare this program with BOXS.
3:
height
2:
width
1 : length
Program
·K
DUP2
:t
F.:OT
4
PICK
:t
+
F.:OT I':OT
:t
+
'J
'-
l
:~:.
Arguments
Results
"7.
~
..
2:
1 : area
Comments
Begin the program.
Calculate wI.
Move
w
to level 1.
Copy h to level 1.
Calculate who
Calculate wI
+
who
Move h and I to levels 2 and 1.
Calculate hI.
Calculate wI
+
wh
+
hI.
Calculate 2(wl
+
wh
+
hI).
End the program.
Because this version of BOXS isn't a user function, it can't be used in
algebraic syntax.
244
28: Programming Examples

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents