HP HP12C hp 12c_user's guide_English_E_HDPMBF12E44.pdf - Page 98
Example
UPC - 882780792104
View all HP HP12C manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 98 highlights
98 Section 8: Programming Basics Example: Create a program that calculates the entries in the AMOUNT, TAX, and TOTAL columns for each item on the jewelry distributor's invoice shown on the next page, and also calculates the total in each of these columns for all items on the invoice. Assume the sales tax is 63/4%. To conserve lines of program memory, instead of keying in the tax rate before the b instruction we'll store it in register R0 and recall it before the b instruction. Before storing the program in program memory, we'll calculate the required amounts for the first item on the invoice manually. The keystroke sequence will use storage register arithmetic (described on page 24) in registers R1, R2, and R3 to calculate the column sums. Since these registers are cleared when fCLEAR² is pressed, we'll press those keys before beginning the manual calculation - and also later, before running the program - to ensure that the column sums are "initialized" to zero. (Pressing fCLEARH would clear registers R1 through R3, but would also clear R0, which will contain the tax rate.) File name: hp 12c_user's guide_English_HDPMBF12E44 Printered Date: 2005/7/29 Page: 98 of 209 Dimension: 14.8 cm x 21 cm