Using Calculator 63
Defining a program
Defining a program is similar to defining a multiple-line function. The
Prgm...EndPrgm template serves as a container for the program
statements.
As an example, create a program named
g(x,y) that compares two
arguments. Based on the comparison, the program should display the
text “x greater than y” or “x not greater than y” (showing the values of x
and y in the text).
1. On the Calculator entry line, type Define prog1(x,y)=. Do not press
Enter yet.
2. On the
Functions & Programs menu, select Prgm...EndPrgm.
Calculator inserts the template.
3. On the Functions & Programs menu, select Control, and then select
If...Then...Else...EndIf.
Calculator inserts the template.
4. Type the remaining parts of the function, using the arrow keys to
move the cursor from line to line.