Chapter 17: Preview Of Programming; Preview Of Programming - Texas Instruments TI-89 Manual Book

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

Advertisement

Preview of Programming

Write a program that prompts the user to enter an integer, sums all integers from 1 to the
entered integer, and displays the result.
Steps
1. Start a new program on the
Program Editor.
2. Type
(with no spaces) as
PROG1
the name of the new program
variable.
3. Display the "template" for a new
program. The program name,
, and
Prgm
EndPrgm
automatically.
After typing in an input box such as
Variable, you must press ¸ twice.
4. Type the following program
lines.
Request "Enter an
integer",n
Displays a dialog box that
prompts "Enter an integer", waits
for the user to enter a value, and
stores it (as a string) to variable n.
expr(n)! n
Converts the string to a numeric
expression.
0! temp
Creates a variable named temp
and initializes it to 0.
For i,1,n,1
Starts a For loop based on
variable i. First time through the
loop, i = 1. At end of loop, i is
incremented by 1. Loop continues
until i > n.
temp+i! temp
Adds current value of i to temp.
EndFor
Marks the end of the For loop.
Disp temp
Displays the final value of temp.
276
Chapter 17: Programming
³
TI.89
Keystrokes
O 7 3
D D
P R O G j 1
¸ ¸
are shown
Type the
program lines
as shown.
Press ¸
at the end of
each line.
TI.92 Plus
Keystrokes
O 7 3
D D
P R O G 1
¸ ¸
Type the
program lines
as shown.
Press ¸
at the end of
each line.
Display

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents