I would really like to have a factoring program for my Pre-calc class. I suck at factoring and absolutely hate it. Does anyone have any ideas to help me get started writing this factoring program? I would like for this to factor quadratics, trinomials, and 4-term polynomials.
My code so far:

Code:
ClrHome
Menu("WHAT WOULD YOU LIKE TO FACTOR?","QUADRATICS",1,"TRINOMIALS",2, "QUIT",3
Lbl 3
Stop
End


Edit by Merth: Deleted superfluous poll.
Hey, I have only taken Algebra 1 (in Geometry right now), so I don't know a lot about factoring, but I did make a program that can factorize expressions like X+BX+C. It's not the greatest, and can only directly factor the expression if A=1 (not 2X+blahblahblah or something), but I'll post it here anyways. I went back and chopped off the parentheses, but I haven't optimized the While C/X+X!=B and C/X+X!=-B part. (I'm too lazy to figure out the best way to do so.)

Code:
:ClrHome
:Prompt B,C
:1→X
:While C/X+X≠B and C/X+X≠-B
:If X>abs(C:Then
:"Error!"
:Goto E
:End
:X+1→X
:End

:While 0
:Output(3,1,"(X+ )(X+ )"
:Output(3,4,abs(X
:Output(3,11,abs(C/X
:If X<0:Output(3,3,"-"
:If C/X<0:Output(3,10,"-"
:End

:{X,C/X
:If C/X+X=-B
:-Ans
:Lbl E
:DelVar BDelVar CDelVar XAns

I'll explain this when I feel like it later, but I will note that the While 0 loop is basically a comment. It was supposed to display something like (X+2)(X+3) rather than {2,3}, but believe it or not I kept getting confused on problems like "Factorize M+5M+6" and would accidentally write "(X+2)(X+3)" so I disabled it. I didn't really want to remove it, though, so I just did that.

Also of note is that, if the very last line of code changes the Ans variable, then the calculator will display Ans instead of "Done".
Thanks, Hitec.

I used to have a lot longer program that would reliably factor quadratics... but now it's gone. It involved gcd( of a number though. What else it had, I can't remember.
Here is something that may be useful. This may be what caleb1997 is thinking of.
I would not rely on a program to do a skill that will later become important later in your education.
This does seem to help.. but which program do I put on my Graphing Calculator ? The first one, or the last one, or one between the two?
If you must factor simple quadratic formulas like ax^2+bx+c, it is a bit simple, the two factor are the negatives of the solutions to ax^2+bx+c=0
So, that equation gives us the solutions (-B+-sqrt(D))/(2A)
So, to speak in factors:
(X+(B-sqrt(D))/(2A))(X+(B+sqrt(D))/(2A))
  
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