Question: In this lab assignment, you will be implementing a part of Array Ploynomial.java that is a specific implementation of Polynomial ADT mentioned in homework assignment
In this lab assignment, you will be implementing a part of Array Ploynomial.java that is a specific implementation of Polynomial ADT mentioned in homework assignment 2. In this implementation you will be using an array to store the coefficients where the k-th position in the array contains coefficient of xk in the polynomial. It will be zero if x* term does not exist in the polynomial. You are provided a starter file for Array Polynomial.java with data members defined. You need to complete the following (non-default) constructors: public ArrayPolynomial (int power, double coefficient) throws Exception (.....) public ArrayPolynomial (Polynomial another) throws Exception (..) You also need to complete the following functions: public void addTerm(int power, double coefficient) throws Exception (..) public double coefficient(int power) (..) public int degree () {..) public boolean equals (Object other) (..) Make sure you run Array Polynomial.java with the JVM option "-ea" in order to enable assertions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
