Design, implement and test an object-oriented


Design, implement and test an object-oriented Java program for processing single-variable polynomials represented as lists. Consider polynomials with integer coefficients and positive integer exponents. Implement the operations of addition and subtraction of two polynomials.

Read the polynomials from an input file which should be either supplied as command line parameter or the user should be invited to specify it. A polynomial is represented in the input file by its name, the equal sign, and a set of pairs of integers, each pair consisting of the exponent and its corresponding coefficient (see the Examples section below). 

For example, P1 = 3 5 1 -4 0 8 represents the polynomial 5X^3 -4X + 8. 

After reading the polynomials, they will be displayed on the screen in human readable form (see the required format in the Examples section below). A polynomial will always be written from the highest exponent to the lowest. A term having coefficient value zero will be omitted. 


The operations on polynomials will be entered by the user from the console (see the Examples section below). After executing the required operation: (i) the program should store the new generated polynomial (to be further used in other operations in the same execution session), (ii) the result will be shown at the console in human readable form and (iii) the user will be allowed to specify another operation or to exit the program.

2. Examples
Example of input file content:
P1 = 3 5 1 -4 0 8 POL2 = 5 6 2 -2 1 7 0 -4
Beta = 3 -4 2 7 0 -3


Example of the console output in human readable form:
P1 = 5X^3 -4X +8 POL2 = 6X^5 -2X^2 +7X -4
Beta = -4X^3 +7X^2 -3


Example of user specified operation:

Please enter the first polynomial operand: POL2 
Please enter the second polynomial operand: P1 
Please enter the operation: -
Please enter the name of the new polynomial: P3
Executing the operation ...
P3 = 6X^5 -5X^3 -2X^2 +11X -12
Do you want to continue (Y or N)?  

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Design, implement and test an object-oriented
Reference No:- TGS088155

Expected delivery within 24 Hours