A polynomial may be represented as a linked list where each node contains the coefficient term of the polynomial. The polynomial 4 X¹-3 X- -5 would be represented as a linked list given below. Equation! KEYWORDS: Classes Pointers Submit 3 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. 2 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) Equation: Equation2: Result: -5 NOTE: Must write a very general program using Object oriented concept. Do not use any library functions All methods used in the program MUST be written in C++ and included in the program. B) Equation1: Equation2: Result: C) Equation1: Equation2: Result: 0 3₂ a. Documented program b. Input file. < Must contain the sample equations given below> 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) 18X-7X+6X² +6 8X³-7X+6X² +6 8X³-7X²+6X+9X³-8 X³ +6X+17X³-X² -2 8X-7X+6X¹+9X²-8X+9 26X-7X-X'+15X² -8X+15 8X-6+5X² +6X²+8X³-7X² +6X 9X³-6X²+5X + 18X²-9 8X-7X+14X³ +5X +26X³ +6X-15
A polynomial may be represented as a linked list where each node contains the coefficient term of the polynomial. The polynomial 4 X¹-3 X- -5 would be represented as a linked list given below. Equation! KEYWORDS: Classes Pointers Submit 3 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. 2 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) Equation: Equation2: Result: -5 NOTE: Must write a very general program using Object oriented concept. Do not use any library functions All methods used in the program MUST be written in C++ and included in the program. B) Equation1: Equation2: Result: C) Equation1: Equation2: Result: 0 3₂ a. Documented program b. Input file. < Must contain the sample equations given below> 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) 18X-7X+6X² +6 8X³-7X+6X² +6 8X³-7X²+6X+9X³-8 X³ +6X+17X³-X² -2 8X-7X+6X¹+9X²-8X+9 26X-7X-X'+15X² -8X+15 8X-6+5X² +6X²+8X³-7X² +6X 9X³-6X²+5X + 18X²-9 8X-7X+14X³ +5X +26X³ +6X-15
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Please write a SIMPLE C++ Code that takes the equation numbers of A,B and C from the input file, adds the 2 polynomials equations adjacent to each other together and then print out the results to an output file. Please include all files that should be in the code to your response. also make sure that the code is runnable. The prompt with all other directions is down below. A mini sample code is also there if you need any help
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 6 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education