HP 15c User Manual

Page 94

Advertising
background image

94

Section 8: Program Branching and Controls

Keystrokes

Display

l * 1

010-45,20, 1 Recall multiplication with the

contents of R

1

(N

0

), yielding N

t

,

the mci of

131

I remaining after t

days

´©

011- 42 31 Pauses to display N

t

.

l 2

012- 45 2 Recalls limit value to X-register.

| T 9

013-43,30, 9 xy ? Tests whether limit value

(in X) meets or exceeds N

t

(in Y).

| n

014- 43 32 If so, program ends.

3

015- 3 If not, program continues.

O+ 0

016-44,40, 0 Adds 3 days to t in R

0

.

tA

017- 22 11 Go to ―A‖ and repeat execution

to find a new N

t

from a new t.

Notice that without lines 012 to 014, the loop would run indefinitely (until
stopped from the keyboard).

Let's run the program, using t

1

= 2 days, N

0

= 100 mci, and a limit value of

half of N

0

(50 mci).

Keystrokes

Display

| ¥

Run mode (display will vary).

2 O 0

2.0000

t

1.

100 O 1

100.0000

N

0

.

50 O 2

50.0000

Limit value for N

t

.

´A

2.0000

t

1.

84.0896

N

1

.

5.0000

t

2.

64.8420

N

2

.

8.0000

t

3.

50.0000

N

3

.

50.0000

N

t

limit; program ends.

Advertising