Associated Topics || Dr. Math Home || Search Dr. Math

Writing a TI-82 Program

```
Date: 02/20/98 at 21:46:25
From: George Guyer
Subject: Writing a TI-82 Program

Could you tell me where I could find out how to write a program that
will solve quadratic equations on my TI-82 calculator? I know that I
can download one off the Internet but I would rather write it myself.
Can you send me the keystrokes necessary or the code as it is written?

Thanks,
Gig
```

```
Date: 03/01/98 at 23:30:06
From: Doctor Jen
Subject: Re: Writing a TI-82 Program

Hi there,

If I send you the code as it is written, won't that be just the same
as if you downloaded the code off the net? You could do that, look at
the code and see if you can work out how the program was written.
That's often a good way to learn about programming anyway.

I have a TI-85, and I wrote a similar program not so long ago.
I could tell you the thought processes that went into making the
program, if you like. That would give you a guide for where to go.
Your manual will tell you how to program your calculator to make it do
what you want it to do (read the chapter on programming). If you
don't have a manual or you want something a little more specific,
(use PRGM|edit).

If we have a quadratic of the form a(x^2) + bx + c = 0, we use the
quadratic formula to solve it, i.e.

-b +- (sqrt)(b^2 - 4ac)     where (sqrt) is 'the square root of'
x = -------------------------    +- is 'plus or minus'.
2a

You need to start up a new program, of course. PRGM|edit gives you
a prompt; type in what you want your program to be called.

First your calculator needs to know what values you intend to use for
a, b, c. (You can use PROMPT for this - Prompt a,b,c. This stores your
values to a, b and c)

Then think about how you'd go about solving the equation by hand,
using the formula. Your program will be doing this work for you,
so you need to tell it what you would do, using the general values
a, b and c. (You might want to take this in several steps, if you
don't want to type it in all in one go.) Then when you run the program
it will work out a value of x according to the formula. The formula
says x =..., so you need to tell your calculator to give the answer it
gets a name (store the result of the formula to X1, say, using STO> ).

You need two solutions, one where you add (sqrt)(b^2 - 4ac) to -b, and
one where you take it away. Tell your calculator to do both. So you'll
eventually get two answers - maybe X1 and X2, one for the version
where you added, one where you took it away.

Finally, you need to tell your calculator to give you the answers it
got. You can use Disp for this, or Outpt. Try both, see which you
prefer.

I do hope you have a manual that can tell you how to find your way
around in the program editor. Hope this very rough guide gave you
an idea of how to start.

Good luck with writing your program.

-Doctor Jen,  The Math Forum
Check out our web site http://mathforum.org/dr.math/
```
Associated Topics:
High School Calculators, Computers

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search