Computer Science 2023 A Polynomial Of A Real Valued Solution NetBeans Solution
2023 CSE231 Assignment Three A polynomial of a real valued variable x is | Assignment Collections
CSE231: Assignment Three
A polynomial of a real valued variable x is an expression of the form a
n
x
n
+ an-1
x
n-1
+ … +
a
1
x
1
+ a0
where a0
, …, a
n
are real constants, called coefficients. For instance, 2.5x
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.5x
3
+1.2x-5. This is a constructor.
2. Adding one polynomial to another. For example, if this object represents
2.5x
3
+1.2x-5 then adding another object representing 7x
4
+2x
3
+x
2
+3 to this object
changes this object so that it represents 7x
4
+5.5x
3
+x
2
+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
2x
2
+x-5 then multiplying it by another object representing 3x
3
+x
2
+3 changes this
object so that it represents 6x
5
+5x
4
-14x
3
+x
2
+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 2x
2
+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 3x
3
+x
2
-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,
flow diagrams, or sequence diagrams;
Code;
Screen snapshots of test runs.
We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.