HP·38E/38C - Slide Rule Museum
HP·38E/38C - Slide Rule Museum
HP·38E/38C - Slide Rule Museum
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
108 Decisions<br />
How it works: The I GTO I 03 instruction causes the calculator to break<br />
the sequential execution and resume from the new line.<br />
Since execution is transferred to the instruction in line 03 each time the<br />
calculator encounters the I GTO I 03 instruction in line 10, the calculator<br />
will remain in this " loop," continually adding one to the number in<br />
storage register R[ and displaying the new number and its square.<br />
Looping techniques like the one illustrated here are common and<br />
extraordinarily useful in programming. By using loops, you take<br />
advantage of one of the most powerful features of your calculator-the<br />
ability to update data and perform calculations automatically, quickly ,<br />
and if you so desire, endlessly.<br />
Conditional Tests and Conditional Branching<br />
Often there are times when you want a<br />
program to make a decision. For<br />
example, suppose an accountant wishes<br />
to write a program that will calculate<br />
the amount of tax to be paid by a number<br />
of persons. For those with incomes of<br />
$10,000 or less , the tax is 17%. For<br />
those with incomes of more than<br />
$10,000, the tax is 20%. A flowchart for<br />
the program might look like this: