Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA PLEASE!!! PLEASE READ AND DO IT CORRECTLY, IT HAS 2 PARTS: MAIN PROGRAM AND EXTRA CREDIT, I WILL ASK ANY QUESTION THAT MIGHT

IN JAVA PLEASE!!!

PLEASE READ AND DO IT CORRECTLY, IT HAS 2 PARTS: MAIN PROGRAM AND EXTRA CREDIT, I WILL ASK ANY QUESTION THAT MIGHT HAVE IF THE CODE CAN'T RUN SO PLEASE CHECK IF I HAVEN'T UPVOTE YOUR ANSWER, I WILL UPVOTE FOR RIGHT ANSWER.

Your assignment is to make a class called Poly that implements addition, negation, subtraction, and any other incomplete method shown in the Poly starter code. You may include any other methods needed to make the driver function.

A polynomial is an arithmetic expression of the form:

anxn + + a2x2 + a1x1 + a0

where x is a variable that can take on different numeric values and an , , a2, a1 , and a0 are constants called the coefficients of the polynomial. The highest exponent with non-zero coefficient, n, is called the degree of the polynomial. For example, 0x2 + 4x + 5 is normally written as 4x + 5 and has degree 1.

Note: A polynomial whose coefficients are all zero has degree -1.

One way to represent a polynomial is to use an array to hold the coefficients. A polynomial of degree n has n + 1 coefficients. An array of size k can hold the coefficients for a polynomial of degree k 1 (or a smaller degree).

For instance:

4x5 + 2x4 + 3x2 - 4x + 5

can be represented as this array:

image text in transcribed

Coefficients are in reverse order in the array.

For extra credit: implement multiplication and division (both quotient and remainder).

0 1 2 3 4 5 5 431024

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

6. What data will she need?

Answered: 1 week ago

Question

1. How did you go about making your selection?

Answered: 1 week ago