Hello, Cemetechians. I am new to Cemetech and dont know anything. I am in highschool and trying to find a way to have the calculator factor trinomials for me on the TI-84 PLUS CE. I created my own program, it didn't work. I found a better one, still didn't work. Can anyone please find the mistake or what would be the issue for this program to work.


Code:
ClrHome
AxesOff
PlotsOff
GridOff
FnOff
ClrDraw
Disp " Quadratic"," Solver",""
Disp "Ax²+Bx+C=0",""
Input "A = ",A
Input "B = ",B
Input "C = ",C
ClrHome
If (B²-4*A*C)<0:Then
B²-4AC→D
(­B+√(D))/(2A)→K
(­B-√(D))/(2A)→J
Text(­1,1,0,"Complex Solutions")
Text(­1,20,0,"Solutions:")
Text(­1,30,0,"X1 = ",round((­B/(2*A)),2),"+",round((√(­D)/(2*A)),2),"i")
Text(­1,40,0,"X2 = ",round((­B/(2*A)),2),"-",round((√(­D)/(2*A)),2),"i")
Pause :ClrHome:AxesOn
Stop
End
If fPart(√(B²-4*A*C))≠0:Then
B²-4AC→D
(­B+√(D))/(2A)→K
(­B-√(D))/(2A)→J
Text(­1,1,0,"Not Factorable")
Text(­1,20,0,"Solutions:")
Text(­1,30,0,"X1 = ",round(K,5))
Text(­1,40,0,"X2 = ",round(J,5))
Pause :ClrHome:AxesOn
Stop
End
gcd(abs(A),gcd(abs(B),abs(C)))→G
If G≠0:Then
(A/G)→A
(B/G)→B
(C/G)→C
End
If fPart(√(A))=0 and B=0 and fPart(√(abs(C)))=0:Then
√(A)→A
√(abs(C))→C
Text(­1,1,0,"Factored Form")
Text(­1,15,0,G,"(",A,"X+",C,")(",A,"X-",C,")")
Text(­1,30,0,"2 Real Roots")
Text(­1,40,0,"X1 = ",­C,"/",A)
Text(­1,50,0,"X2 = ",C,"/",A)
Pause :ClrHome:AxesOn
Stop
End
(A*C)→D
0→L
1→J
While L≠B
(D/J)→K
If fPart(K)=0:Then
J+K→L
J+1→J
Else
J+1→J
End
End
J-1→J
A→O
gcd(abs(K),abs(O))→H
(K/H)→K
(O/H)→H
gcd(abs(J),abs(A))→M
(J/M)→J
(A/M)→A
If (­K/H)=(­J/A):Then
Text(­1,1,0,"Factored Form")
Text(­1,15,0,G,"(",H,"X+",K,")²")
Text(­1,30,0,"1 Real Root")
Text(­1,40,0,"X = ",­K,"/",H)
Else
Text(­1,1,0,"Factored Form")
Text(­1,15,0,G,"(",H,"X+",K,")(",A,"X+",J,")")
Text(­1,30,0,"2 Real Roots")
Text(­1,40,0,"X1 = ",­K,"/",H)
Text(­1,50,0,"X2 = ",­J,"/",A)
End
Pause :ClrHome:AxesOn
Stop
It'll be very difficult for anybody to identify what the problem with your program might be if you don't describe how it "doesn't work."
Tari wrote:
It'll be very difficult for anybody to identify what the problem with your program might be if you don't describe how it "doesn't work."

Tari is being difficult, but if you go read that long document hyperlink labeled "Ask questions the smart way" in Tari's signature, Tari will be less difficult. I will try to be only semi-difficult.
I wrote one of these a month or so back actually, and it worked great, then I lost it to a ram reset. It wasn't anywhere near as fancy as this though... Is this the one you wrote yourself or the one you "borrowed for double-checking your math homework" Regardless, your script here is very long, and to be blunt, I don't want to read it. Please take my advice below and resubmit your question if you so wish:
1) Attempt to narrow down where in the code the problem occurs
2) If nothing is happening say so, likewise if a specific error appears on the screen, say so
3) Do some digging, change settings, re-locate segments, and report findings, nobody here wants to spoon feed you answers unless you do some real work
4) STF(friking)W?
5) If this isn't your program, check the readme most people include with their files for potential help
6) I feel you though, as I too am a freshman in highschool with my new, big boy, TI-84+CE Python Edition calculator to play games on, and TI-Basic isn't exactly javascript, python, or anything like that. But at least do grammer man. (And maybe watch a youtube tutorial or 2)
7) If you don't know what a function does, on the selection menu for it, press plus and you will get a helpful popup to make sure you set up your built-ins right. You can use Gotos and Labels to only run specific segments if you want to do some manual debugging.
8 ) The TI84+CE comes with a built-in app called PlySmlt2 that does factoring FOR YOU.
9) If you found the factoring program here on Cemetech at the top of a search bar, I near guarantee its a you problem, not an us problem
I'm sorry if my advice is too general, you didn't give me a lot to go on. Like I said, no shame in taking my advice, then applying it to ask the same question again. Chances are, if you do everything on that list, the problem will resolve itself one way or another.
Not to get too much into it but I don't think tari is being difficult so to speak - This post is saying there are 'multiple' errors with the program but for some reason doesn't list what any of them are?

karimalawi are you able to let us know what the main issues are? Are you receiving any specific errors or are you not getting the results you expect?
Tari; You kind of got off the subject with your response. He’s a newbie and maybe doesn’t know everything he should do. I don’t mess around with writing code on TI calculators because it’s too time consuming keying in the code. I don’t have my TI 84+ CE hooked up to a PC, so I have to key everything in. I do all my coding on an iPad in Lua because it easier and faster. But since no one was answering his question, I took the time to key it in and see what happens. So here’s what I found.

1. Near the beginning of the code, the statement B2+4AC ->D gives a negative number in D. Then the several statements after that which use D will give an error because it can’t take the square root of a negative number. So I added the line of code abs(D)->D after the B2+4AC->D and that fixed that problem to make D positive.

2. Every text statement is wrong for the TI 84+ CE. The text in the code has 4 arguments whereas the TI 84+ CE uses 3 arguments. Also, the values for the row, column are reversed. So every text statement needed to be changed. Here is how I change the text statements. I remover each ,0 and changed the row,column values.

Text(1,1,”whatever text goes here”
Text(20,1,”whatever text goes here”
Text(40,1,”whatever text goes here”
Text(60,1,”whatever text goes here”.

so each text statement after the first one in each group I incremented by 20.

The program now runs but I can’t say if it gives the correct answer every time or not because I didn’t try everything.

karimalawi;
If you make these changes and still have trouble, then be more specific about the error. I can’t post the corrected code here since I don’t want to key it in again.

After playing with this more, the program goes into a loop when both constants are negative, example x2-9x+20 which should give (x-4)(x-5) . There are probably other issues, but I haven’t tried every +/- combination.
  
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