Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Algebra Expert

Create a class Polynomial and a corresponding test class that is used to evaluate a polynomial function of x: P(x) = a0 + a1 * x + a2 * x ** 2 + ......+an * x ** n; ai is coefficient i, and x ** n means x to the power of n The coefficients ai, are of type double, and the exponents of x are integers. The largest exponent n is called the degree of the polynomial which is an integer >= zero. The class has the attributes: degree, the value of the largest exponent n. coefficients, an array of coefficients ai. And the following methods: Polynomial (max), which is a constructor that creates a polynomial of degree max with all "degree plus one" coefficients of zero. setConstast(i, value), sets the coefficient ai to value. evaluate(x), returns the value of polynomial for the given x. For example, p(x) = 3 + 5x + 2 * x** 3 is of degree 3, has coefficients a0 = 3, a1 = 5, a2 = 0,and a3 = 2. The invocation of evaluate(7) computes: 3 + 5 * 7 + 0 * 7 ** 2 + 2 * 7 **3 which returns 724.

Algebra, Academics

  • Category:- Algebra
  • Reference No.:- M91596942
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Algebra

Assignment topic - abstract algebraq1 let r be the ring of

Assignment Topic - Abstract Algebra Q1: Let R be the ring of all 2 X 2 matrices over Z p , p is a prime. Let G be the set of elements x in the ring R such that det(x) ≠ 0. Find the order of G. Q2: If R is a commutative r ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As