Answered step by step
Verified Expert Solution
Question
1 Approved Answer
AP Computer Science A sd and Division Project: Polynomial Multiplication that is an array of integers, representing the a store the polynomial p(r) 4r3-7r2 +
AP Computer Science A sd and Division Project: Polynomial Multiplication that is an array of integers, representing the a store the polynomial p(r) 4r3-7r2 + 5+ 2, you would er eate th a Java class Polynomial, which has oue instance variable nd implehe coefficients of a polynomial. For instance, if you wanted to int3 polyCoetfs (4, -7, 5, 2): and then call the constructor using polyCoefts as the argument Polynomial polynev Polynomial (polyCoeffs); You will need to implement the following methods: ultiply()-takes in an object of class Polynomial and multiplies it with the Pe from which it is being invoked. For example, to multiply Polynomial objecta eo you would type into the main) method poly1.multiply(poly2); (of course, since polynomial multiplication is commutative, this should give you the sane resiult a poly2.multiply(poly1)). The method should output an object of class Pol the product 1ynomial, representing . divide() - takes in an object of class Polynomial (the divisor) and divides the Polynomial object from which it is being invoked. For example, to divide dividendPoly by divisorPoly, you woald type into the main() method dividendPoly.divide (divisorPoly); The method should output an array of two Polynomial objects (one being the quotient and the other being the remainder). You will be provided with the following methods: . main) The main() method that you are provided with contains different Polynomial objects with which you are to test your code. You are encouraged to add more Polynomial objects if you would like to test more cases, but do not remove what you are provided with. isEqual) takes in a Polynomial object and compares it to the Polynomial object from which the method is invoked, returns true if the two objects are equivalent and false if they are not. nicely in the console, using powers of z. example we did in class). This is provided for testing and debugging purposes, but it doesn't need . printPolynomial) a static method that takes in an object of class Polynomial and prints in . printArray() - a static method that takes in an array and prints it in the console (similar to the to be used in the final product. Copy and paste the Polymomial.tzt file found on MyDJO (in the Projects folder) into Eelipse or jGrasp and work from that, filling in the required methods. Due Date: Friday, February 8th, 2019
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started