Question: please code PolyCalc in java please. i have provided the other class Poly Poly Calc . This class will contain some calculus we can perform


Poly Calc . This class will contain some calculus we can perform on a Poly object. You do not need to define a constructor. This class will behave as a utility class in the sense that we do not need to create an instance of the class to access its members, java.lang. Math is another example of this kind of class. To make this possible, we simply need to define a member as static PolyCalc has a static method called differentiate() This method should calculate the coufficients for the derivative of the supplied Poly object. It should then create a new Poly object from those coefficients and return it. The new coeficients array should ALWAYS be the same length as the original array. Also, you do not need to round coefficients. PolyCalc has a static method called integrate() . This method should calculate the coefficients for the integral of the supplied Poly object. It should then create a new Poly object from those coefficients and retum L. Assume the integration constant is always 0. The new coefficients array should ALWAYS be the same length 1 as the orginal array integrals go up an order). It does not matter if the original array is 10, 0, 0, 11, the new array should then be (0, 0, 0, 1.0. Also, you do not need to found coefficients. Poly Cale java java Poly.java package mymath; public class Poly { public double polynonint); private double x; public Poly(double polynomial()) { this.polynomial = polynomial; x = 0; } I 1 related problem public double[] getPolynomial(){ return polynomial; } public void setPolynomial(double[] polynoniel){ this.polynomial = polynomial; } public void setX(double x) { this.x = x } public double getX(){ return this.x; } O public double evaluate(){ double sun; sum = 0.8; for(int i = 0; i 0) { 11 (polynomial. Length - 1 - 1 == 0) { str + + polynomial[1]; } else { str polynomial[i] + XA" + (polynomial.Length - 1 - 1); } } else { if (polynomial.Length - 1 - 1 == 0) { str - " + (-polynomial[1]); } else { str (-polynomial[i]) + "x4" + (polynomial. Length - 1 - 1); } } } 1/print the str if(str.trim().charAt(0) == '-') { System.out.println(str.trim()); } else { //remove the extra + System.out.println(str.trim().substring(1).trim()); D 3 16 5 8 70 e 72 TODO Problems Terminal Bulld Poly Calc . This class will contain some calculus we can perform on a Poly object. You do not need to define a constructor. This class will behave as a utility class in the sense that we do not need to create an instance of the class to access its members, java.lang. Math is another example of this kind of class. To make this possible, we simply need to define a member as static PolyCalc has a static method called differentiate() This method should calculate the coufficients for the derivative of the supplied Poly object. It should then create a new Poly object from those coefficients and return it. The new coeficients array should ALWAYS be the same length as the original array. Also, you do not need to round coefficients. PolyCalc has a static method called integrate() . This method should calculate the coefficients for the integral of the supplied Poly object. It should then create a new Poly object from those coefficients and retum L. Assume the integration constant is always 0. The new coefficients array should ALWAYS be the same length 1 as the orginal array integrals go up an order). It does not matter if the original array is 10, 0, 0, 11, the new array should then be (0, 0, 0, 1.0. Also, you do not need to found coefficients. Poly Cale java java Poly.java package mymath; public class Poly { public double polynonint); private double x; public Poly(double polynomial()) { this.polynomial = polynomial; x = 0; } I 1 related problem public double[] getPolynomial(){ return polynomial; } public void setPolynomial(double[] polynoniel){ this.polynomial = polynomial; } public void setX(double x) { this.x = x } public double getX(){ return this.x; } O public double evaluate(){ double sun; sum = 0.8; for(int i = 0; i 0) { 11 (polynomial. Length - 1 - 1 == 0) { str + + polynomial[1]; } else { str polynomial[i] + XA" + (polynomial.Length - 1 - 1); } } else { if (polynomial.Length - 1 - 1 == 0) { str - " + (-polynomial[1]); } else { str (-polynomial[i]) + "x4" + (polynomial. Length - 1 - 1); } } } 1/print the str if(str.trim().charAt(0) == '-') { System.out.println(str.trim()); } else { //remove the extra + System.out.println(str.trim().substring(1).trim()); D 3 16 5 8 70 e 72 TODO Problems Terminal Bulld
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
