Question: One of the exercises in Chapter 3 asked you to write a method that would find the roots of a quadratic equation of the form
One of the exercises in Chapter 3 asked you to write a method that would find the roots of a quadratic equation of the form ax2 + bx + c = 0. The quadratic method was passed a , b , and c and then applied the following quadratic formula:

Under what conditions would this formula fail? Modify the quadratic method so that it will reject invalid values of a , b , or c by throwing an exception.
-b+ V 4ac x = 2
Step by Step Solution
3.35 Rating (167 Votes )
There are 3 Steps involved in it
The quadratic method would fail if the coefficient a is ... View full answer
Get step-by-step solutions from verified subject matter experts
