Hey all!
I have recently been trying to make a program for the TI-84 plus, but it just won't work for me. I am pasting it below. I know that I shouldn't use goto, but it was a bad habit I picked up in middle school. Sorry!
The problem with it is that it doesn't seem to be using nested ifs right. For instance, if I type in V=-999 and N=-999, it will still go through that first if statement, even though I think that xor is supposed to only continue if one and only one of the statements are true. "Correct" values, for example, might be A=10, T=1, D=5, O=0, V=10, and N=0, and if you eliminate any two, the other 4 should be able to find them.
ClrHome
Disp "ENTER KNOWNS OR"
Disp "–999"
Disp "DO"
Input O
Disp "D"
Input D
Disp "VO"
Input N
Disp "V"
Input V
Disp "A"
Input A
Disp "T"
Input T
Lbl 1
If V=–999 xor (N=–999 xor (A=–999 xor T=–999))
Then
Disp "T"
If V=–999
Then
N+A*T→V
End
If N=–999
Then
V-A*T→N
End
If A=–999
Then
(V-N)/T→A
End
If T=–999
Then
(V-N)/A→T
End
End
If D=–999 xor (O=–999 xor (N=–999 xor (V=–999 xor T=–999)))
Then
If D=–999
Then
O+.5(V+N)T→D
End
If O=–999
Then
D-.5(V+N)T→O
End
If V=–999
Then
(D-O-.5N*T)/(.5T)→D
End
If N=–999
Then
(D-O-.5V*T)/(.5T)→N
End
If T=–999
Then
(D-O)/(.5(V+N))→T
End
End
If D=–999 xor (O=–999 xor (N=–999 xor (T=–999 xor A=–999)))
Then
If D=–999
Then
O+N*T+.5*A*T^2→D
End
If O=–999
Then
D-N*T-.5*A*T^2→O
End
If A=–999
Then
(D-O-N*T)/(.5*T^2)→A
End
If T=–999
Then
(–N+√(N^2-4*O*.5*A))/(2*O)→B
(–N-√(N^2-4*0*.5*A))/(2*O)→C
Disp "IS TIME ="
Disp "B: "B
Disp "OR"
Disp "C: "C
Input T
End
End
If A=–999 xor (D=–999 xor (O=–999 xor (V=–999 xor N=–999)))
Then
If A=–999
Then
(V^2-N^2)/(2*(D-O))→A
End
If D=–999
Then
(V^2-N^2+2*A*O)/(2*A)→D
End
If O=–999
Then
(2*A*D-V^2+N^2)/(2*A)→O
End
If V=–999
Then
√(2*A*D-2*A*O+N^2)→B
–√(2*A*D-2*A*O+N^2)→C
Disp "IS V="
Disp "B: "
Disp B
Disp "C: "
Disp C
Input V
End
If N=–999
Then
√(V^2-2*A*D+2*A*O)→B
–√(V^2-2*A*D+2*A*O)→C
Disp "IS N="
Disp "B: "
Disp B
Disp "C: "
Disp C
Input N
End
End
If A=–999 OR D=–999 OR O=–999 OR T=–999 OR V=–999 OR N=–999
Goto 1
ClrHome
Output(1,1,"A: ")
Output(1,4,A)
Output(2,1,"D: ")
Output(2,4,D)
Output(3,1,"O: ")
Output(3,4,O)
Output(4,1,"T: ")
Output(4,4,T)
Output(5,1,"V: ")
Output(5,4,V)
Output(6,1,"N: ")
Output(6,4,N)