Section 9: Branching and Looping 135
File name: HP 12c Pt Converted_user's guide_English_HDP0F123E02_080207
Page: 271 of 281
Printed Date:
{
2007/8/2Dimension: 14.8 cm x 21 cm
Keystrokes
(ALG mode)
Display
:
0
002,
45
0
Recalls test value into X-register
and places income in Y-register.
~
003,
34
Places income in X-register and
test value in Y-register.
§
004,
20
Prepares for multiplication.
go
005,
43
34
Tests whether number in X-register
(income) is less than or equal to
number in Y-register (20,000).
gi
009
006,43, 33,
009
If condition is true, branches to
program line 009.
:
2
007,
45
2
If condition is false, recalls 25%
tax rate to X-register.
gi
010
008,43, 33,
010
Branches to program line 010.
:
1
009,
45
1
Recalls 20% tax rate to X-register.
b
010,
25
Divides tax rate by 100.
}
011,
36
Calculates tax.
fs
–190.22
Sets calculator to Run mode.
(Display shows results of running
of previous program.)
Now, we'll store the required numbers in registers R
0
, R
1
, and R
2
, then we’ll run
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)
Display
20000
?
0
20,000.00
Stores test value in register R
0
.
20
?
1
20.00
Stores 20% tax rate in register R
1
.
25
?
2
25.00
Stores 25% tax rate in register R
2
.
15000
15,000.
Keys income less than test value
into display and X-register.
Ê
001,
45
0
Line 001:
:
0.
Содержание 12C
Страница 1: ...HP 12c Platinum Financial Calculator User s guide H Edition 5 HP part number F2231AA 90001 ...
Страница 15: ...Part I Problem Solving ...
Страница 48: ...48 Section 3 Basic Financial Functions ...
Страница 92: ...92 Section 5 Additional Operating Features Keystrokes RPN mode Display 987z 434 65 The correct answer ...
Страница 104: ......
Страница 105: ...Part II Programming ...
Страница 156: ......
Страница 157: ...Part III Solutions ...
Страница 216: ...216 Section 14 Leasing Keystrokes RPN mode Keystrokes ALG mode Display fL12 fL 12 18 10 Annual yield to lessor ...
Страница 230: ......
Страница 231: ...Appendices ...
Страница 277: ......