Microsoft Word - LabAssignment2.docx CS 114 Spring 2020 (Sections 008/010/012) Lab Assignment 2 Polynomial ADT In this lab assignment, you will be implementing a part of ArrayPloynomial.java that is a...

Coding


Microsoft Word - LabAssignment2.docx CS 114 Spring 2020 (Sections 008/010/012) Lab Assignment 2 Polynomial ADT In this lab assignment, you will be implementing a part of ArrayPloynomial.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 ?"in the polynomial. It will be zero if ?"term does not exist in the polynomial. You are provided a starter file for ArrayPolynomial.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 ArrayPolynomial.java with the JVM option “-ea” in order to enable assertions.
Jan 29, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here