SOLUTION: The common algorithm for calculating the roots of a quadratic equation by the quadratic formula requires considering several special cases in your code, including consideration of
Algebra.Com
Question 456779: The common algorithm for calculating the roots of a quadratic equation by the quadratic formula requires considering several special cases in your code, including consideration of special cases when one or more coefficients vanish. Write appropriate comments for this algorithm so that the comments make it easy to see the different cases and how they are handled. Write accompanying documentation to explain the algorithm. Total target answer should be no more than 2 pages
I need help on this ASAP
Tks
Answer by solver91311(24713) (Show Source): You can put this solution on YOUR website!
Either share the particular "common algorithm" with which you are dealing, or go ask this question on a Computer Science website.
In general though, if your coefficients are a, b, and c, then the cases would be:
1. a = 0; the code should return a message to the user that this is not a quadratic.
2. b = 0, but a and c not equal to zero and the signs on a and c are opposite: the code should return an answer
3. b = 0, but a and c not equal to zero and the signs on a and c are the same: the code should return either "No solution over the reals" or an answer of
depending on whether the algorithm is designed to handle complex number roots or not.
4. b = 0 and c = 0, then x = 0.
5. a, b, and c non-zero, then:
5a. if
, then
and the single root has a multiplicity of 2.
5b. if
, then
5c. if
, then the algorithm should return either "No solution over the reals" or an answer of
depending on whether the algorithm is designed to handle complex number roots or not.
John

My calculator said it, I believe it, that settles it
RELATED QUESTIONS
Find the roots of each equation using the Quadratic Formula
(answered by jorel1380)
Developing and Analyzing the Quadratic Formula
This formula, which is called the... (answered by stanbon)
develop an algorithm to calculate all possible roots of a quadratic... (answered by Fombitz,ikleyn)
use the quadratic formula to find the roots of each quadratic equation.... (answered by nerdybill)
Complete parts a-c for each quadratic equation
a) find the value of the discriminant... (answered by jim_thompson5910)
Complete parts a-c for each quadratic equation
a) find the value of the discriminant
b) (answered by ankor@dixie-net.com)
Complete parts a-c for each quadratic equation
a) find the value of the discriminant
b) (answered by solver91311)
Complete parts a-c for each quadratic equation
a) find the value of the discriminant
b) (answered by solver91311)
Complete parts a-c for each quadratic equation
a) find the value of the discriminant
b) (answered by solver91311)