Single Variable Polynomial (from text file)
I want to modify the below code to read the nodes from a text file (vs. hard-coded values) Furthermore, read data from text file in the format: P1 = 3 5 1 -1 0 8 P2 = 5 6 2 -1 1 7 0 -4 etc... Name the values P(x) and input the remaining data. Any advice? import java.io.DataInputStream; import java.util.LinkedList; import java.util.ListIterator; // A term contains the coefficient and the exponent of x. class Term { public Term(int c, int d) { coeff = c; degree = d; } public Term multiply(Term other) { return new Term(coeff * other.coeff, degree + other.degree); } public void add(int c) { coeff