Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Data Structure Expert

A polynomial of a real valued variable x is an expression of the form a

n x n + an-1xn-1 + ... + a1x1+ a0

where a0 , ..., an are real constants, called coefficients.

For instance, 2.5 x 3 +1.2x-5 is a polynomial of x with a3=2.5, a2=0, a1=1.2 and a0=-5.

In this project, you are required to develop a class named Polynomial that supports symbolic manipulation of polynomials of a fixed variable x, that is, all polynomials are polynomials of the same variable x. Your class must at least support operations for

1. Constructing a polynomial given an array of coefficients. For example, given the float point number array {2.5,0.0,1.2,-5}, the operation constructs a Polynomial  object representing 2.5x3+1.2x-5.

This is a constructor.

2. Adding one polynomial to another. For example, if this object represents 2.5x3+1.2x-5 then adding another object representing 7x4+2x3+x2+3 to this object 

changes this object so that it represents 7x4+5.5x3+x2+1.2x-2.

Note that the ranks (the largest exponent) of the two polynomials are not necessary the same.

3. Multiplying one polynomial by another. For example, if this object represents

2x2+x-5 then multiplying it by another object representing 3x3+x2+3 changes thisobject so that it represents 6x5+5x4-14x3+x2+3x-15. Again the ranks of the two polynomials are not necessary the same.

4. Evaluating a polynomial for a given value for x. For instance, if this object represents 2x2+x-5 then evaluating it for x=2 yields 5.

5. Converting a Polynomial object to a string so that the Polynomial object can be displayed. If this object represents 3x3+x2-1 then the method should return "3*x^3 + x^2 - 1" although "3*x^3 + 1*x^2 + 0*x^1 + (-1)" is acceptable

1. Specify, design and implement Polynomial. Your implementation must use linked lists to represent polynomials.

2. Write an interactive test program that tests all the public methods of the Polynomial class.

Please submit the following.

 Analysis: test data;

 Design:

1. Class diagrams showing representation of data;

2. A class invariant for each class;

3. Pre/Post conditions for required operations;

4. Algorithms for required operations. Algorithms can be described in English,

Data Structure, Computer Science

  • Category:- Data Structure
  • Reference No.:- M91411978
  • Price:- $45

Priced at Now at $45, Verified Solution

Have any Question?


Related Questions in Data Structure

Problem regarding the management program

Problem: Looks like its just adding a save and load feature to the same file you sent me for python 3.5 Until now, you have had to leave your team management program running on your computer indefinitely since you did no ...

Data Communication Delivering Information anywhere

Topic: Data Communication Delivering Information anywhere. Write a 9-12 pages paper in which you: Present an overview of the origin and history of the concept. Describe the current use of and attitude toward the concept. ...

  • 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