HP 12c User Manual page 110

Financial calculator
Hide thumbs Also See for 12c:
Table of Contents

Advertisement

110 Section 9: Branching and Looping
Keystrokes
gi07
:2
gi08
:1
b
fs
Now, we'll store the required numbers in registers R
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
20000?0
20?1
25?2
15000
Ê
Ê
Ê
Ê
File name: hp 12c_user's guide_English_HDPMBF12E44
Printered Date: 2005/7/29
Display
04- 43, 33
07
If condition is true, branches to
program line 07.
05-
45
2
If condition is false, recalls 25% tax
rate to X-register.
06- 43, 33
08
Branches to program line 08.
07-
45
1
Recalls 20% tax rate to X-register.
08-
25
Calculates tax.
–12.36
Sets calculator to Run mode.
(Display shows results of running of
previous program.)
, R
0
Display
20,000.00
Stores test value in register R
20.00
Stores 20% tax rate in register R
25.00
Stores 25% tax rate in register R
15,000.
Keys income less than test value into
display and X-register.
01-
45
0
Line 01: :0.
20,000.00
Test value has been recalled to
X-register, moving income to
Y-register.
02-
34
Line 02: ~
15,000.00
Income has been placed in
X-register and test value has been
placed in Y-register.
03-
43
34
Line 03: go
15,000.00
04- 43, 33
07
Condition tested by o was true,
so program execution continued
with line 04: gi07.
Page: 110 of 209
Dimension: 14.8 cm x 21 cm
, and R
, then we'll run the
1
2
.
0
.
1
.
2

Advertisement

Table of Contents
loading

Table of Contents