Question: Please Write a SIMPLE step by step C++ program with the prompt. example outputs are under the direction A polynomial may be represented as a

Please Write a SIMPLE step by step C++ program with the prompt. example outputs are under the direction Please Write a SIMPLE step by step C++ program with the prompt.

A polynomial may be represented as a linked list where each node contains the coefficient and exponent of a term of the polynomial. The polynomial 4X33X23 would be represented as a linked list given beloiv. Write a COMPLETE program that reads two polynomials in any order of exponent from an input file, stores them as sorted (in the descending order of the exponents) linked lists, adds them together, and prints the result as a polynomial to an output file. The result should be a third linked list. Hint: Travers both polynomials. If a particular exponent value is present in either of the two polynomials being summed, then it should be present in the answer. If it is present in both polynomials, then its coefficient is the sum of the corresponding coefficient in both polynomials. (If this sum is zero, the term should be deleted). NOTE: Must write a very general program using Object oriented concept. Do not use any library functionsAll methods used in the program MUST be written in C++ and included in the program. KEYWORDS: Classes Pointers Submit a. Documented program b. Input file. c. Output file. d. All items stapled. Test run for the following inputs (Do not change the order of exponent in the input file) A) Equation 1 : 18X57X3+6X2+6 Equation2: 8X27X2+6X3+9X28X+9 Result:26X57X4X3+15X28X+15 B) Equation 1 : 8X37X5+6X2+6 Equation1:Equation2:8X37X5+6X2+68X57X2+6X4+9X38 Result: X5+6X4+17X3X22 C) Equation I : 8X36+5X5+6X2+8X87X7+6X Equation2:Result:8X36+5X5+6X2+8X87X7+6X9X26X4+18X398X87X7+14X5+5X4+26X3+6X15 A polynomial may be represented as a linked list where each node contains the coefficient and exponent of a term of the polynomial. The polynomial 4X33X23 would be represented as a linked list given beloiv. Write a COMPLETE program that reads two polynomials in any order of exponent from an input file, stores them as sorted (in the descending order of the exponents) linked lists, adds them together, and prints the result as a polynomial to an output file. The result should be a third linked list. Hint: Travers both polynomials. If a particular exponent value is present in either of the two polynomials being summed, then it should be present in the answer. If it is present in both polynomials, then its coefficient is the sum of the corresponding coefficient in both polynomials. (If this sum is zero, the term should be deleted). NOTE: Must write a very general program using Object oriented concept. Do not use any library functionsAll methods used in the program MUST be written in C++ and included in the program. KEYWORDS: Classes Pointers Submit a. Documented program b. Input file. c. Output file. d. All items stapled. Test run for the following inputs (Do not change the order of exponent in the input file) A) Equation 1 : 18X57X3+6X2+6 Equation2: 8X27X2+6X3+9X28X+9 Result:26X57X4X3+15X28X+15 B) Equation 1 : 8X37X5+6X2+6 Equation1:Equation2:8X37X5+6X2+68X57X2+6X4+9X38 Result: X5+6X4+17X3X22 C) Equation I : 8X36+5X5+6X2+8X87X7+6X Equation2:Result:8X36+5X5+6X2+8X87X7+6X9X26X4+18X398X87X7+14X5+5X4+26X3+6X15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!