
Page 21-53
As you can see, f3c produces exactly the same results as f3. The only
difference in the programs is the branching constructs used. For the case of
function f
3
(x), which requires five expressions for its definition, the CASE
construct may be easier to code than a number of nested IF … THEN …
ELSE … END constructs.
Program loops
Program loops are constructs that permit the program the execution of a
number of statements repeatedly. For example, suppose that you want to
calculate the summation of the square of the integer numbers from 0 to n, i.e.,
∑
=
=
n
k
k
S
0
2
To calculate this summation all that you have to do is use the
‚½
key
within the equation editor and load the limits and expression for the
summation (examples of summations are presented in Chapters 2 and 13).
However, in order to illustrate the use of programming loops, we will calculate
this summation with our own User RPL codes. There are four different
commands that can be used to code a program loop in User RPL, these are
START, FOR, DO, and WHILE. The commands START and FOR use an index
or counter to determine how many times the loop is executed. The commands
DO and WHILE rely on a logical statement to decide when to terminate a
loop execution. Operation of the loop commands is described in detail in the
following sections.
The START construct
The START construct uses two values of an index to execute a number of
statements repeatedly. There are two versions of the START construct:
START…NEXT and START … STEP. The START…NEXT version is used when
the index increment is equal to 1, and the START…STEP version is used when
the index increment is determined by the user.
Commands involved in the START construct are available through:
Содержание 48GII
Страница 1: ...hp 48gII graphing calculator user s guide H Edition 4 HP part number F2226 90020 ...
Страница 162: ...Page 3 37 Define this function by any of the means presented above and check that g 3 3 g 1 0 g 1 0 g 3 9 ...
Страница 201: ...Page 5 30 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Страница 381: ...Page 11 55 Function KER Function MKISOM ...
Страница 461: ...Page 13 26 In the right hand side figure above we are using the line editor to see the series expansion in detail ...
Страница 777: ...Page 26 8 ...
Страница 840: ...Page L 5 ...