So I have a few programs related to quadratic formula -

One that gives you the solutions - https://raw.githubusercontent.com/T3M1N4L/Calc-Programs/refs/heads/main/QUADSOLV.8xp
One that gives you the quadratic factors - https://raw.githubusercontent.com/T3M1N4L/Calc-Programs/refs/heads/main/QFACTOR.8xp
One that gives you the discriminant -


Code:


Prompt A,B,C
B^2-4AC
If not(Ans
Disp "ONE ROOT
If Ans>0
Disp "TWO ROOTS
If Ans<0
Disp "NO ROOTS



All of these have the same sort of input thing where it asks for a, b, and c
is it possible to combine all of these programs together so that it shows you the solutions, the quadratic factors, and the discriminant? if so can someone compile all the programs above into one and send it over? I would do it myself if I were experienced in TI-BASIC.
Just copy-and-paste everything in the second two into the first one, and delete all but the first "Prompt A,B,C".
Like so:

Code:

Prompt A,B,C
B^2-4AC
If not(Ans
Disp "ONE ROOT
If Ans>0
Disp "TWO ROOTS
If Ans<0
Disp "NO ROOTS
{A,B,C,D,E,F,0}→⌊V
iPart(log(abs(A)))+1+(abs(A)≠1)+(A<0)→D
Output(1,1,A)
Output(1,D,"X²+")
Output(1,D+3-(B<0),B)
If B<0
Output(1,D+2,"-")
If B≠0
Then
D+iPart(log(abs(B)))+3+(abs(B)≠1)→D
Output(1,D,"X+")
Else
D+1→D
End
Output(1,D+2-(C<0),C)
If C<0
Output(1,D+1,"-")
Output(1,D+3+iPart(log(abs(C))),"=")
If (B²-4AC)<0
Goto 7
If √(B²-4AC)≠int(√(B²-4AC))
Goto 7
0→D
gcd(abs(A),abs(B))
gcd(abs(Ans),abs(C))→E
If E≠1
Then
If A<0
Output(2,1,"­")
Output(2,2,E)
D+iPart(log(E))+1→D
End
1→E
0→⌊V(7)
(­B-√(B²-4AC))/(2A)
Lbl 1
If A<0
Output(2,1,"­")
Output(2,D+2,"(X+")
If fPart(Ans)≠0
Then
Ans→F
0→E
Lbl 2
E+1→E
If fPart(round(EF,7))=0
Goto 3
Goto 2
Lbl 3
Output(2,D+3,E)
D+iPart(log(E))+1→D
Output(2,D+3,"X+")
round(EF,7)
End
Output(2,D+4+(Ans≥0),Ans)
If Ans>0
Then
Output(2,D+4,"-")
Else
Output(2,D+4,"+")
End
D+5+iPart(log(abs(Ans)))→D
Output(2,D+1,")")
⌊V(7)+1→⌊V(7)
If ⌊V(7)≤1
Then
1→E
(­B+√(B²-4AC))/(2A)
Goto 1
End
Disp "",""
⌊V(1)→A:⌊V(2)→B:⌊V(3)→C:⌊V(4)→D:⌊V(5)→E:⌊V(6)→F:DelVar ⌊V
Goto 8
Lbl 7
Output(2,1,"DOES NOT FACTOR")
Lbl 8
(­B+√(B²-4AC))/(2A→D
(­B-√(B²-4AC))/(2A→E
Disp " "
Disp "X="
Output(6,4,D
Disp "X="
Output(7,4,E


I kind of made that in a hurry and didn't look through all of it, but assuming A, B, and C never change, this should work fine.
What about creating a program that would have a menu?


Code:

Menu("Quadratic Solver","Quadratic Equation",1,"Factoring",2,"Root Finder",EN


I am just not sure about how the labels work, since I just started programming a few weeks ago.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement