Question: Develop 2 classes: A class named: Polynomial The class will have the following items, shown on page 5 6 6 : instance variables methods Also,
Develop classes:
A class named: Polynomial
The class will have the following items, shown on page :
instance variables
methods
Also, include the following additional methods:
A method to enter a value for x
This is to be used during the polynomial evaluation
Another method to display:
the polynomial
the result of the polynomial evaluation is displayed
A demo class
This is where objects of the first class are instantiated
For a polynomial:
Input data through a method call is provided
Polynomial evaluation through a method call is done
The polynomial is displayed
The result of the polynomial evaluation is displayed
Input Requirements:
For a polynomial, enter its:
"degreethe value of the largest exponent n
coefficientsan array of the coefficients ai
Processing:
Once an object is instantiated, perform the following operations through method calls:
setting up the polynomial by entering input data
evaluating the polynomial
displaying the polynomial
displaying the result of the polynomial evaluation
Output Requirements:
For a given polynomial, display each of the following preceded by an appropriate message:
the polynomial
the result of the polynomial evaluation for a given value of x
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
