subject

In Java, design an interface named Polynomial. This is your polynomial abstract data type. It should have the following method signatures: A method addTerm that takes a coefficient and a power (both integral numbers) and adds the resulting term to the polynomial. (in order to build a polynomial term-by-term.) It should throw an IllegalArgumentException if a negative power is passed to it.
A method removeTerm that takes a power and removes any and all terms in the polynomial with that power.
A method getDegree that returns the degree of this polynomial.
A method getCoefficient that takes a power and returns the coefficient for the term with that power.
A method evaluate that takes a double-precision decimal number and returns a double-precision result.
A method add that takes another Polynomial object and returns the polynomial obtained by adding the two polynomials. Ensure that this method does not mutate either polynomial. The implementation may assume that the given Polynomial is the of the same concrete class as this object; if it is a different class, the method may throw an IllegalArgumentException.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:50, nicoleskertich
You have written, as part of a school assignment, a research paper on the solar system. you want to share this paper on your school website. on which type of server will you upload it?
Answers: 1
image
Computers and Technology, 23.06.2019 00:30, alex7078
Quick pl which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, jason9394
Facial expressions and gestures are examples of messages.
Answers: 3
image
Computers and Technology, 24.06.2019 18:10, albattatasraap5wymy
Most information security incidents will occur because of select one: a. users who do not follow secure computing practices and procedures b. increases in hacker skills and capabilities c. poorly designed network protection software d. increasing sophistication of computer viruses and worms
Answers: 1
You know the right answer?
In Java, design an interface named Polynomial. This is your polynomial abstract data type. It should...

Questions in other subjects:

Konu
Arts, 09.06.2021 02:00
Konu
Mathematics, 09.06.2021 02:10
Konu
Mathematics, 09.06.2021 02:10