Example: Using Alternative Approaches - Texas Instruments TITANIUM TI-89 User Manual

Titanium graphing calculator
Hide thumbs Also See for TITANIUM TI-89:
Table of Contents

Advertisement

Example: Using Alternative Approaches

Example: Using Alternative Approaches
Example: Using Alternative Approaches
Example: Using Alternative Approaches
The example in the Previews module shows a program that prompts the user to enter an
integer, sums all integers from 1 to the entered integer, and displays the result. This
section gives several approaches that you can use to achieve the same goal.
Example 1
Example 1
Example 1
Example 1
This example uses
to display the result.
Text
:prog1()
:Prgm
Ê
:InputStr "Enter an integer",n
Ë
:expr(n)!n
:0!temp:1!I
Ì
:While i{n
©Ì
:
temp+i!temp
©Ì
:
i+1!I
Ì
:EndWhile
Í
:Text "The answer is "&string(temp)
:EndPrgm
Ê
Prompts for input on Program I/O screen.
Ë
Converts string entered with InputStr to an expression.
Ì
Loop calculation.
Í
Displays output in a dialog box.
Programming
for input, a
InputStr
loop to calculate the result, and
While...EndWhile
637

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-89 voyage 200Titanium ti-89

Table of Contents