Ok, so I’ve been trying my ass off to get this program to work. First off the program is suppose to ask you to enter the coefficients of the polynomial, then it’s suppose to tell you if it has Two real roots, One Real Root, or none at all, also it’s suppose to say the answer. Now, I went about this by creating two different functions: one for linear equations & one for quadratic equations. After that everything is going fine I just don’t know how to program the functions itself for the linear function I have to take into account b==0 which I did and I need one for b==0, and c==0 at the same time and I’m stuck there.

And my quadratic function is just totally ****ed up I honestly don’t know where to go from there I inputed the formula and it seems to run fine, but it won’t tell you if it’s two roots or not it just gives you one of the roots.

## Open Me

```
#include <bjarne/std_lib_facilities.h>
// function declarations
void solve_linear(double b, double c);
void solve_quadratic(double a, double b, double c);
int main()
{
// input the coefficients of the polynomial
double a = 0, b = 0, c = 0; // coefficients of the polynomial
// Professor said something is wrong here I'm not sure what?
cout << "Enter the coefficients of a quadratic polynomial a*x**2 + b*x +c:" << endl;
cout << " a? ";
cin >> a;
cout << " b? ";
cin >> b;
cout << " c? ";
cin >> c;
// handle degenerate case (linear equation) and quit
if (a == 0) // linear equation, not quadratic
solve_linear(b, c);
else // genuine quadratic equation ... forge ahead
solve_quadratic(a, b, c);
}
// solve the linear equation b*x + c == 0
void solve_linear(double b, double c)
{
cout << "Trying to solve linear equation "
<< b << "*x + " << c << " == 0
";
if (b==0)
{
cout << "This is the contradictory statement " << c << " == 0.
";
}
else
{
if (c==0)
{
if (b==0){
cout << "This is the trivial identity 0 == 0.
";}
}
}
}
// use classical quadratic formula to solve a genuine quadratic equation
// a*x^2 + b*x + c ==0, with a != 0
void solve_quadratic(double a, double b, double c)
{
cout << "Trying to solve the quadratic equation "
<< a << "*x*x + " << b << "*x + " << c << " == 0
";
int x;
x = (-b + sqrt((b*b)-(4*a*c)))/(2*a);
}
```

Here is an example of how the program is supposed to look:

[details=Open Me]

[/details]