Quadratic Formula - TI 89 or TI 92

Introduction
This program solves equations of the form Ax2+Bx+C=0 by using the quadratic formula.
 
If you have not used one of the programs posted on this website before, you should read through the information in the Intro to Programming section first.


If you have a TI Connectivity Cable, you can download the program main.quad.89p


The Program
:quad( ) {This will already appear if you named the program quad}
:Prgm {This will already appear}
:ClrIO {ClrIO is in the CATALOG menu}
:Lbl p {Lbl is in the CATALOG menu}
:Local a,b,c {Local is in the F4 menu}
:Input "a=", a {Input is in the F3 menu} { "  is on the  1 button}
:Input "b=", b
:Input "c=", c
:(b2-4*a*c)d {The arrow is STO} {The  *  is the times sign}
:If d<0 Then {If Then Else EndIf   is in the F2 menu} {< is on the zero button}
:Disp "no real solutions" {Disp is in the CATALOG menu}
:Else
:((-b+(d))/(2*a))e {The is square root}{The - is the negative sign}
:((-b-(d))/(2*a))f {The second - is the subtraction sign}
:Disp "solutions",e,f
:EndIf
:Goto p {Goto is in the CATALOG menu}
:EndPrgm {This will already appear}


Running the program
 
You will be asked to enter values for a, b, and c according to the quadratic formula. To test your program try the following:
 
a=2, b=3, c=4. Your answer should be NO REAL SOLUTIONS.
 
a=5, b=4, c=-2. Your answer should be .348331477355, -1.14833147735.