E-42
•Example: Use Heron’s formula to perform a series of calculations to
determine the area of triangles for which the length of side A is fixed, and
the lengths of sides B and C are variable.
Program
?→A: Lbl 1: ?→B: ?→C: (A + B + C) ÷ 2→D^D × (D – A) × (D – B) ×
(D – C): Ans^Goto 1
kConditional Jump Using a Relational Operator
You can use relational operators so program execution compares two
values and then decides which processing should be performed based on
the relationship between the two values.
•Example: To create a program that calculates the total of a series of input
values, with calculation being terminated whenever zero is input
Program
0→B: Lbl 1: ?→A: A = 0 S Goto 2: B + A →B: Goto 1: Lbl 2: B
12
Statement 1 Statement 2
3
1 Assigns 0 to variable B.
2 Assigns the input value to variable A.
3 If A = 0 is true, Statement 1 (Goto 2) is executed. If false, execution
advances to Statement 2 without executing Statement 1.
u Relational Operator Notes
•The relational operators you can use in a program are: =, G, >, >.
•A relational operation that is true returns a value of 1, while a false
relational operation returns a value of 0. For example, executing 3 = 3
would return a result of 1, while 1 > 3 returns a result of 0.
kOther Program Statements
u F Key Settings
The items shown below can be included as statements inside of a program.
You can input one of these statements using the same procedure as you do
for normal calculation. That is, press the F key to display a selection
screen and then press the number key that corresponds to the setting you
want.
Deg, Rad, Gra, Fix, Sci, Norm, Dec, Hex, Bin, Oct
•Example: Deg: Fix 3