HP 12C Platinum Owner's Handbook Manual page 105

And problem-solving guide
Hide thumbs Also See for 12C Platinum:
Table of Contents

Advertisement

Y-registers (as also explained in Appendix A): that is, it will place the income
back into the X-register and place the test value into the Y-register. This is
necessary because when either the :2 instruction in line 005 or the :1
instruction in line 007 is executed, the number in the X-register is moved into the
Y-register; if the ~ instruction were not included, the test value 20,000, rather
than the income, would be in the Y-register when the b instruction in line 008
is executed.
Keystrokes
Display
(RPN mode)
f]
fs
007,43,33,002 Sets calculator to Program mode.
fCLEARÎ
000,
:0
001,
~
002,
go
003,
gi007
004,43,33,007 If condition is true, branches to
:2
005,
gi008
006,43,33,008 Branches to program line 008.
:1
007,
b
008,
fs
–12.36
Now, we'll store the required numbers in registers R
the program, using Ê so that we can check that the branching occurs properly.
It's good practice with programs containing conditional test instructions to check
that the program branches correctly for all possible conditions: in this case, if the
income is less than, equal to, or greater than the test value.
Section 9: Branching and Looping
Sets RPN mode.
(Display shows program line at
which execution was halted at end
of preceding example.)
Clears program memory.
0 Recalls test value into X register
45
and places income in Y-register.
34 Places income in X register and
test value in Y-register.
34 Tests whether number in
43
X-register (income) is less than or
equal to number in Y-register
(20,000).
program line 007.
2 If condition is false, recalls 25%
45
tax rate to X-register.
1 Recalls 20% tax rate to X-register.
45
25 Calculates tax.
Sets calculator to Run mode.
(Display shows results of running
of previous program.)
, R
, and R
0
1
107
, then we'll run
2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents