Question: Description For this problem you will be making your own package called mymath. This package will have two classes: Poly and BabyCalc. Both classes require

 Description For this problem you will be making your own package
called mymath. This package will have two classes: Poly and BabyCalc. Both

Description For this problem you will be making your own package called mymath. This package will have two classes: Poly and BabyCalc. Both classes require completo Javadoc document comments. Also make sure you create the package and add both classes to it. Poly This class will model a polynomial of the form: Ak-1+By+2... Ux+Wx? + Yx+Z. It has one constructor that takes an array of double coefficients of sizen in 0. le, you can assume that only non-empty arrays will be passed to the constructor For example, to make the polynomial 4x + 3x - 2, it should be made this way new Poly (naw double(){4. 3, -2)). The same polynomial could also be made this way new Poly(new double(10, 0, 0, 4, 3, -21). You are free to store these parameters however you choose. Poly has a method called evaluate(). This method will return the double value of the polynomial evaluated for a given x (you can tap into java.lang.Math> for some handy maths operators). Poly has a method called printPoly ). This method should print the polynomial out in the form mentioned above: ax + bx2 + x + d. However, terms with coefficients should be omitted. For example, the polynomial 5.5x - 3.1x + 3 should be printed as: *5.5x^2 - 31891 +3.0". If the Poly has all O coefficients, print an empty String You can define accessor methods for Poly and keep track of any other attributes you like. 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 sens 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 otatie. PolyCalc has a static method called difforentiato().This method should calculate the coefficients for the derivative of the supplied Poly object. It should then create a new Poly object from those coefficients and return it. The new coefficients array should ALWAYS be the same length as the original array. Also, you do not need to round coefficients. PolyCak: 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 return it. Assume the integration constant is always 0. The "new coefficients" array should ALWAYS be the same length +1 as the original 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 round coefficients. Add Configuration ain Mainjava public class Main public static void main(String[] args) { 1/ create some Poly objects and test your PolyCalc.differentiate()/integrate() methods here

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!