In this project we created two main classes, which called "Polynom" and "Monom" that implements several interfaces. And also a "Test" class for JUnit We chose linkedlist as our data Structure, because we think it more useful, efficient and dynamic to changes. so that each node will contain one monom.
Note: We assumed that the input is normal , according to Elizabeth.
For ex: 3*x^2+5 2*x^2-3 2x 2X
We needed to do a class which representing a function of the form f(x)= a*x^b. This class was very useful for us, because we used her methods to the polynom class. So this class contains constructors and Methods.
- Get a two numbers one to the coefficient and one to the power, to create a new monom
- Copy from other monom.
- Makin from a string.
- derivative This function compute a new monom which is the derivative of this monom.
- f This functiom compute the value of f(x).
- multiply This function multiplies one monom in another monom.
- ToString This function print a string of the monom.
A polynomial consists of monoms, as we said earlier, his methods were helped by the Monom functions.
- Default This is a default constructor for the polynom. We created a default monom and insert to the Polynom.
- Copy This is a copy constructor from one polynom to another.
- String Transformer This is a constructor that transforms a string to a polynom.
- Add – to add two polynoms.
- Copy – from one to another
- Derivate - Compute a new Polynom which is the derivative of this Polynom.
- Equals- Test if this Polynom is logically equals to another
- Multiply- Multiply two polynoms.
- Root
- Area
1.0
Yoav and Elad.