Ask your own question, for FREE!
Mathematics 8 Online
OpenStudy (anonymous):

Where do I have extra brackets in this quadratic equation? (see description)

OpenStudy (anonymous):

I am writing a program in java to calculate the roots of a quadratic using the common quadratic equation. It all has to be one line (I'm trying to explain the QE to a computer). I am unable to run my program because there is apparently a missing bracket. This is my line: ((b*(-1))+sqrt(pow(b,2)-(4*a*c))/(2*a) for those of you who don't know: pow(1, 2) means raise the 1 by the power of the 2 sqrt() means square root what is in the brackets Thanks

OpenStudy (anonymous):

sorry, i didn't mean "extra brackets" I meant missing brackets (I think)

OpenStudy (anonymous):

There would be another bracket after 4*a*c to close the very first bracket

OpenStudy (anonymous):

((b*(-1))+sqrt(pow(b,2)-(4*a*c)))/(2*a)

OpenStudy (anonymous):

you're right, thanks :)

OpenStudy (anonymous):

now to test it :)

OpenStudy (anonymous):

yep, it works. I've just got to sort the 12 errors which appeared after the brackets issue was fixed lol fml...

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!