Education Technology

Solution 11734: Creating Repetition in a TI Basic Program on the TI-89 Family, TI-92 Family, and Voyage™ 200 Graphing Calculators.

How can I create a repetition in a TI Basic program on the TI-89 Family, TI-92 Family, and Voyage 200?

There are three structures that allow to program tasks that repeat. The three repetition structures are:

• The Loop...EndLoop.
• The For ...EndFor.
• The While...EndWhile.

Each structure is different in its use and provide a unique advantage.

Use the Loop..EndLoop when the number of times needs to be repeated is not known. It must include an exit condition allowing to leave the loop. The program will repeat the loop until the condition is met. It will then exit and execute the first statement after EndLoop. The loop will be executed endlessly, unless a Goto or Exit instruction is executed.

Program segment example:

:If die1=6 and die2=6
:Goto End
:Lbl End
:Disp "The number of rolls is",i

Use the For...EndFor when the number of times the loop should be repeated is known.

Program segment example:

:For i,1,100,step
:Disp tempsum

Please Note: After the segment above executes, the content of the variable tempsum is 5050.

Use the While...EndWhile when testing the condition is important. The block will execute as long as the condition is true.

Program segment example:

:While i <= 20
:Disp "sum of reciprocal up to 20", temp

Please see the TI-89 family, TI-92 family, and Voyage 200 guidebooks for additional information.