1

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?

some_person
  • 197
  • 3
  • 12

3 Answers3

3

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!

JFed-9
  • 297
  • 3
  • 17
1

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.

fuzzything44
  • 701
  • 4
  • 15
1

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
Timtech
  • 1,224
  • 2
  • 19
  • 30