
Page 21-59
Use
@SST
↓
@
to step into the program and see the detailed operation of each
command.
The FOR construct
As in the case of the START command, the FOR command has two variations:
the FOR…NEXT construct, for loop index increments of 1, and the FOR…STEP
construct, for loop index increments selected by the user. Unlike the START
command, however, the FOR command does require that we provide a name
for the loop index (e.g., j, k, n). We need not to worry about incrementing
the index ourselves, as done in the examples using START. The value
corresponding to the index is available for calculations.
Commands involved in the FOR construct are available through:
„°
@)@BRCH@ @)@FOR
Within the BRCH menu (
„°
@)@BRCH@
) the following keystrokes are available
to generate FOR constructs (the symbol
indicates cursor position):
•
„
@)@FOR
: Starts the FOR…NEXT construct: FOR
NEXT
•
‚
@)@FOR
: Starts the FOR…STEP construct: FOR
STEP
The FOR…NEXT construct
The general form of this statement is:
start_value end_value FOR loop_index program_statements
NEXT
To avoid an infinite loop, make sure that
start_value < end_value
.
Example
– calculate the summation S using a FOR…NEXT construct
The following program calculates the summation
∑
=
=
n
k
k
S
0
2
Содержание 49g+
Страница 1: ...hp 49g graphing calculator user s guide H Edition 4 HP part number F2228 90006 ...
Страница 197: ...Page 5 30 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Страница 377: ...Page 11 55 Function KER Function MKISOM ...
Страница 457: ...Page 13 26 In the right hand side figure above we are using the line editor to see the series expansion in detail ...
Страница 775: ...Page 26 10 the location of the backup battery in the top compartment at the back of the calculator ...
Страница 838: ...Page L 5 ...