ok, here is the assignment my comp sci teacher gave me:
2. The roots of the quadratic equation ax2 + bx + c = 0, where a, b, %26amp; c are real numbers, and a ≠ 0, are given by the following formula:
http://www.people.iup.edu/ykwl/...
In this formula the term b2-4ac is called the discriminant. If b2 - 4ac = 0, so the equation has a single repeated root. If b2 - 4ac %26gt; 0, the equation has two real roots. If b2-4ac %26lt; 0, the equation has two complex roots. Write a program that reads the following values [{1, 3, 1}, {1, 2, 1}, {2, 1, 1}] from the keyboard and assign them to the three sets of coefficients [{a1, b1, c1}, {a2, b2, c2}, {a3, b3, c3}]. The program then outputs the type of the roots of the equation for each set. Furthermore, if b2 - 4ac ≥ 0, the program should output the root(s) of the quadratic equation.
So, i dont understand when he says the "root of the equation". Can someone help me uderstand what i am suspose to do and how i would star off the program?
Help with c++?
Look here
http://en.wikipedia.org/wiki/Quadratic_f...
By "roots" he simply means the value of x.
Your program is supposed to solve the quadratic function.
Reply:The root of the equation is the value x, such that ax2 + bx + c = 0
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment