Texas Instruments TI-89 Manual Book page 300

Ti ti-89: user guide
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

Controlling the Flow
of a Program
Tip: For information, refer to
pages 295 and 297.
Using Indentation
Displaying
Calculated Results
Tip: For a list of available
output commands, refer to
page 302.
Getting Values into
a Program
Tip: For a list of available
input commands, refer to
page 301.
When you run a program, the program lines are executed in
sequential order. However, some commands alter the program flow.
For example:
¦
Control structures such as
test to decide which part of a program to execute.
¦
Loops commands such as
commands.
For more complex programs that
use
If...EndIf
and loop structures
such as
, you can make
For...EndFor
the programs easier to read and
understand by using indentation.
In a program, calculated results are not displayed unless you use an
output command. This is an important difference between
performing a calculation on the Home screen and in a program.
These calculations will not display
a result in a program (although they
will on the Home screen).
Output commands such as
display a result in a program.
Displaying a calculation result does
not store that result. If you need to
refer to a result later, store it to a
variable.
To input values into a program, you can:
¦
Require the users to store a value (with § ) to the necessary
variables before running the program. The program can then refer
to these variables.
¦
Enter the values directly into
the program itself.
¦
Include input commands that
prompt the users to enter the
necessary values when they
run the program.
¦
Require the users to pass one
or more values to the
program when they run it.
If...EndIf
commands use a conditional
For...EndFor
repeat a group of
:If x>5 Then
: Disp "x is > 5"
:Else
: Disp "x is < or = 5"
:EndIf
:12ù 6
:cos(p/4)
:solve(x^2ì xì 2=0,x)
:Disp 12ù 6
will
Disp
:Disp cos(p/4)
:Disp solve(x^2ì xì 2=0,x)
:cos(p/4)! maximum
:Disp maximum
:Disp 12ù 6
:cos(p/4)! maximum
:Input "Enter a value",i
:Request "Enter an integer",n
prog1(3,5)
Chapter 17: Programming
283

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents