Reputation: 197
I get a syntax error when I run the following code:
Prompt A,B,C
B^2-4*A*C→Δ
If Δ IS<(0)
Disp "No Real Solutions"
If Δ=0
Disp "One Solution",-B/(2*A)
If Δ IS>(0)
Then
(-B-√(Δ))/(2*A)→E
(-B+√(Δ))/(2*A)→F
End
Any problems With this code?
Upvotes: 1
Views: 589
Reputation: 1274
Try this:
Prompt A,B,C
B²-4AC
If Ans<0
Disp "No Real Solutions
If not(Ans
Disp "One Solution",-B/2/A
If D>0
Then
(-√(D)-B)/2/A→E
(√(D)-B)/2/A→F
End
Upvotes: 1
Reputation: 701
Your issue is with using
If Δ IS<(0)
The command IS<
does not test for less than. Instead, it takes a variable and a value as parameters, increments the variable, and skips the next line of code if the variable is less than the value. Instead, you want to do If Δ < 0
as said by JFed-9.
Also, the delta may be an issue, but try the above first.
Upvotes: 1
Reputation: 297
I've never seen the 'Δ' symbol on the TI-84 Plus, maybe that could be the problem, but if not, I'm willing to bet that the third line is the issue.
If Δ IS<(0)
is not correct. You should replace it with
If Δ < 0
That should work for you. Other than that, you should be good! Nice starter program by the way!
Upvotes: 3