# HP 12C Platinum User Manual Page 135

Financial calculator.

Keystrokes
(ALG mode)
:0
~
§
go
gi009
:2
gi010
:1
b
}
fs
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.
Keystrokes
(RPN mode)
20000?0
20?1
25?2
15000
Ê
Section 9: Branching and Looping
Display
002,
45
0
003,
34
004,
20
005,
43
34
006,43, 33, 009
007,
45
2
008,43, 33, 010
009,
45
1
010,
25
011,
36
–190.22
Display
Stores test value in register R
20,000.00
Stores 20% tax rate in register R
20.00
Stores 25% tax rate in register R
25.00
Keys income less than test value
15,000.
into display and X-register.
Line 001: :0.
001,
45
0
Recalls test value into X-register
and places income in Y-register.
Places income in X-register and
test value in Y-register.
Prepares for multiplication.
Tests whether number in X-register
(income) is less than or equal to
number in Y-register (20,000).
If condition is true, branches to
program line 009.
If condition is false, recalls 25%
tax rate to X-register.
Branches to program line 010.
Recalls 20% tax rate to X-register.
Divides tax rate by 100.
Calculates tax.
Sets calculator to Run mode.
(Display shows results of running
of previous program.)
, R
, and R
, then we'll run
0
1
2
135
.
0
.
1
.
2