One of the exercises in Chapter 3 asked you to write a method that would find the

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 ax2 + bx + c = 0. The quadratic method was passed a , b , and c and then applied the following quadratic formula:

-b+ V – 4ac x = 2а

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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: