For this project, you must first implement the Polynomial class from the Chapter 3 Programming Project 8

Question:

For this project, you must first implement the Polynomial class from the Chapter 3 Programming Project 8 on page 170. Add a new method to the class with four parameters: a polynomial f and three double numbers x, z, and epsilon. The precondition requires that epsilon is positive and f(x) <= 0 <= f(z).

The method searches for a number y between x and z, where f(y) is zero. Such a number is called a root of the polynomial. The method’s return value might not be an exact root, but the difference between the return value and a real root should be no more than epsilon. The algorithm is a binary search of the numbers between x and z.


Data from Project 8

A one-variable polynomial is an arithmetic expression of the form:

a0 + a1x + a2x2 + … akxk

Implement the polynomial class described in Section 3.4.

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

Step by Step Answer:

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