Displaying Information; Using Local Variables; Example Of A Local Variable - Texas Instruments TI-NSPIRE Software Manual

Cas computer software
Hide thumbs Also See for TI-NSPIRE:
Table of Contents

Advertisement

2.
Run the program to display the volume of a cylinder with a height of
34 mm and a radius of 5 mm.
volcyl(34,5)
Note: You do not have to use the parameter names when you run the
program, but you must supply two arguments (as values, variables,
volcyl
or expressions). The first must represent the height, and the second must
represent the radius.

Displaying information

A running function or program does not display intermediate calculated
results unless you include a
difference between performing a calculation on the entry line and
performing it in a function or program.
These calculations do not display a result in a function or program
(although they do from the entry line).
12
6
¦
cos(
/4)
p
displays calculation result or text in a function or program.
Disp
Disp 12
6
¦
Disp "Result:",cos(
Displaying a result does not store that result. If you expect to refer later
to a result calculated in a program, store the result to a global variable.
cos(
/4)
maximum
p
&
Disp maximum

Using local variables

A local variable is a temporary variable that exists only while a user-
defined function is being evaluated or a user-defined program is
running.

Example of a local variable

The following program segment shows a
discussed later in this module). The variable
cases, the variable
330
Volume = 534.071
command. This is an important
Disp
/4)
p
i
is used only while the program is running.
For...EndFor loop
i
is the loop counter. In most
(which is
Programming

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-nspire

Table of Contents