Constructing a polynomial given an array of coefficients

Assignment Help Data Structure & Algorithms
Reference no: EM13842170

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,

Reference no: EM13842170

Questions Cloud

Write a program to load an array : Write a program to load an array
What is the main theme of the righteous mind : What is the main theme of The Righteous Mind by Jonathan Haidt? What are 2 to 3 similarities between The Righteous Mind and Sam Harris' book Free Will?
A uml class diagram to describe the ordering system class : a UML class diagram to describe the ordering system class
How you as a crisis intervention worker will help the person : For this Assignment, you will pick one of the case studies provided and using the ABC Model of Crisis Intervention, write a six-page paper on how you as a crisis intervention worker will help the person who comes into your office with a crisis
Constructing a polynomial given an array of coefficients : Constructing a polynomial given an array of coefficients
In search of strategy by markides-what is the message : Read the article (In Search of Strategy by Markides) and answer the question What's the message (the idea, concept, thesis)
How much revenue would gonzales company report related : How much revenue would Gonzales Company report related to this contract on its income statement for the year ended December 31, 2013? How much would it report as cash flows from operating activities for 2013?
Define anorexia nervosa : Anorexia Nervosa: Define anorexia nervosa, refer to its prevalence and main symptoms, examine its causes and effects, and consider various treatment options.
Analyze effects of malnutrition and starvation : Effects of starvation: Analyze effects of malnutrition and starvation on individual mental and physical health, as well mention possible social consequences. Conclude what starvation effects you consider most important.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd