Question: need a help to complete this following code in Java. import java.util.LinkedList; import java.util.ListIterator; public class Polynomial { // this is a nested static class,

 need a help to complete this following code in Java. import java.util.LinkedList; import java.util.ListIterator; public class Polynomial { // this is a nested static class, it defines a type // all the instance varaibles can be access directly inside Polynomial class even though they have // private modifier private static class Term{ private double coefficient; private int exponent; public Term(int exp, double coeff ) { coefficient= coeff; exponent = exp; } } // instance variables of Polynomial // first is the term of the Polynomial with the highest degree private LinkedList termList; 1. public Polynomial() { termList = new LinkedList(); termList.add(new Term(0,0)); } 2. public Polynomial(double a0) { termList = new LinkedList(); termList.add(new Term(0,a0)); } 3. public Polynomial(Polynomial p) { } 4. public void add_to_coef(double amount, int exponent) { } 5. public void assign_coef(double coefficient, int exponent) { } 6. public double coefficient(int exponent) { } 7. public double eval(double x) { } The return value is the value of this polynomial with the given value for the variable x. 
 Do not use power method from Math, which is very low efficient 
 8. public boolean equals (Object obj) { if(obj instanceof Polynomial) { } return false; } 9. public String toString() { } 10. public Polynomial add(Polynomial p) { } 11. public Polynomial multiply(Polynomial p) { } } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!