So,
For our first lab in computer science we need to come up with a program that solves ALL values inputted into the quadratic equation. (imaginary, infinite etc). I have been gone for most classes thus far due to sports... and am really behind. Can anyone satisfy this and then explain it? I'mreally lost. this is wht i have so far
include <FPT.h>
int main()
{
double a,b,c,x1,x2;
a=inD() ; b=inD() ; c=inD();
if (a==0 && b==0 && c==0)
{
outS ("There are infinite solutions");
else {

2. Originally Posted by Lucid15
Can anyone satisfy this and then explain it?

Assuming inD and outS are defined in your fpt.h thing, then so far so good. No reason to stop now!

3. I just dont get the concept of what i need to do really. That is all.

4. Well, do the next bit. How do you know if the answers are imaginary/complex?

5. if the number within the sqrt is , right? we need to solve for real, imiginary/complex, infinite, and none i believe.

6. is ... what? But assuming you've filled in the blank correctly, then yes. So check for that.

Then you can check for none.

And then what's left over must be "normal".

7. Sorry i meant to put a 0. After i add all of the exceptions then i ask it to solve the equation at the very end right?

8. Not 0, but negative.

9. ## lost

I dont know why but im soo lost.... I have no idea where to go next. and how the program shold work.

10. > I have been gone for most classes thus far due to sports
Decide which you want to do.

Unless you're naturally gifted in something that you can just do it with minimal instruction, both endeavours pretty much demand full attention. You simply can't coast your way through programming.

Get all the back lectures, and do all the back exercises and you might begin to catch up.

11. ## ok

So i talked to the professor briefly today....
I guess what i really do not understand is where i need to add these "exceptions" in which the quadratic equation can not be solved. for example on the board he wrote...
Code:
```double a,b,c,x;
a=inD();b=inD();c=inD();
if(a==0) {if (b==0){_______}else{x=-c/b;outD(x);}}
else{x=(-b+sqrt(b*b-4*a*c))/(2*a);
outD(x);
}```

12. and i just found out that i will not be missing anymore classes... which is definitely a plus.

13. Well work through the equation and find the parts that would require special handling. And use more whitespace, it helps.

14. yes, and two roots right?

15. Example:
Code:
`#include <complex.h>`
I would post more code... but I think that is a start.. Its not how I would do it if it were my homework, but maybe you will find that of some use.