Sunday, July 26, 2009

Help with c++?

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++?
okay.. i know that the roots of the equation are going to be your values of x that make the problem equal 0, but im sorry, i dont quite know how to start it...


No comments:

Post a Comment