Programming
695
If...Then...EndIf structures
To execute one group of commands if a conditional test is true, use the
structure:
À
Executed only if x>5.
Á
Displays the value of:
2x if x>5
x if x
{
5
Note:
EndIf
marks the end of the
Then
block that is executed if the
condition is true.
If...Then...Else...EndIf structures
To execute one group of commands if a conditional test is true and a
different group if the condition is false, use this structure:
À
Executed only if x>5.
Á
Executed only if x
{
5.
Â
Displays value of:
2x if x>5
5x if x
{
5
If...Then...ElseIf... EndIf structures
A more complex form of the
If
command lets you test for multiple
conditions. Suppose you want a program to test a user-supplied
argument that signifies one of four options.
If x>5 Then
Disp "x is greater than 5"
À
2
¦
x
&
x
À
EndIf
Disp x
Á
If x>5 Then
Disp "x is greater than 5"
À
2
¦
x
&
x
À
Else
Disp "x is less than or equal to 5"
Á
5
¦
x
&
x
Á
EndIf
Disp x
Â
Summary of Contents for TI-Nspire
Page 38: ...26 Setting up the TI Nspire Navigator Teacher Software ...
Page 46: ...34 Getting started with the TI Nspire Navigator Teacher Software ...
Page 84: ...72 Using the Content Workspace ...
Page 180: ...168 Capturing Screens ...
Page 256: ...244 Embedding documents in web pages ...
Page 336: ...324 Polling students ...
Page 374: ...362 Using the Review Workspace ...
Page 436: ...424 Calculator ...
Page 450: ...438 Using Variables ...
Page 602: ...590 Using Lists Spreadsheet ...
Page 676: ...664 Using Notes You can also change the sample size and restart the sampling ...
Page 684: ...672 Libraries ...
Page 714: ...702 Programming ...
Page 828: ...816 Data Collection and Analysis ...
Page 846: ...834 Regulatory Information ...
Page 848: ...836 ...