Assignment (3)

CS1440 – Due Friday Set. 8

1.Write an algorithm to solve the following quadratic equation:

*y = 6x ^{2}+4x+3*

The solution to a 2^{nd}
order quadratic equation y = *ax ^{2}+bx+c is:*

_{}

In our case, *a = 6, b = 4, and c=3.*

This equation can have one of the following three solutions depending on the value of:

*b ^{2} – 4ac. *Here
are the possibilities:

* *If *b ^{2} – 4ac> 0, i.e., b^{2}
> 4ac* then we have two solutions, and

_{}

If
*b ^{2} – 4ac= 0, i.e., b^{2} = 4ac *then we have only one
solution, and

_{}

If
*b ^{2} – 4ac< 0, i.e., b^{2} < 4ac *then there is no
real solution.

(Actually, there are two imaginary solutions, but for now we assume no solution)

Your algorithm must consider all these details and be able to solve all possible cases and print a warning for cases that is unable to solve.

Your algorithm must ask whether you want to solve another equation and proceed if the answer is yes.