The Rogue's
TI-86 BASIC Tutorial
~
Programming Practice for Chapter 4: Basic Control

This program is an updated version of the one from the last chapter. It is a quadratic equation solver that will tell you when the answers are imaginary, and has a nicer feel due to the use of the new commands that you learned in this chapter. Note: Everything in green are comments. Do not type comments into your calculator; they just let you know what a command is doing.

Program: "QUAD2"

:Lbl A Label A
:ClLCD
:Disp "Quadratic Solver v2.0","","Ax²+Bx+C" Display program version and equation format
:Prompt A,B,C Get the coefficients from the user
:B²-4A*C->D Solve the part of the problem that determines if the answer is real; save it to D
:If D<0 If D is negative...
:Then then...
:Pause "Non-real result!" Tell the user that the result is non-real
:Goto Z Jump to label Z
:End Ends the If-Then command
:-B/2A+√(D)/2A->E Find the first answer
:-B/2A-√(D)/2A->F Find the second answer
:ClLCD
:Disp "The Answers are:",E,F Display the answers
:Lbl Z Label Z
:Disp "Do another?" Display a question
:Menu(2,"Yes",A,4,"No",Q If [F2] (Yes) is pressed, go to label A. If [F4] (No) is pressed, go to label Q
:Lbl Q Label Q
:ClLCD


This is a screenshot of the program in action:
Chapter 4 Program: QUAD2


Please close this popup window when you are finished to return to Chapter 2