Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

language is c++. please use the given values. please show the input file and the output. thanks! COMP 2013 ASSIGINMENT #2 2/27/2020 A polynomial may

language is c++. please use the given values. please show the input file and the output. thanks! image text in transcribed
image text in transcribed
COMP 2013 ASSIGINMENT #2 2/27/2020 A polynomial may be represented as a linked list where cach node contains the coefficient and exponent of a term of the polynomial. The polynomial 4 X' .3X -5 would be represented as a linked list given below. Equation1 -- | 3 | 4 | 2 | 3 | | | Write a program system that reads two polynomials in any order of exponent from an input file, stores them as 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 coellicient 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 functions. All methods used in the program MUST be written in CH and included in the program. KEYWORDS: Classes Pointers Submit a. Documented program b. Input file. c. Output file. ALL THREE DOCUEMNTS MUST BE STAPLED. Test run for the following inputs (Do not change the order of exponent in the input file) A) Equation1: Equation 2 : Result: 8X-7X+6X? +6 8x - 7X2 + 6x4 +9X-8 x + 6x +17X-X2 - 2 B) Equation1: Equation 2 : 8 -6 + 5x + 6X? + 8X-7x' +6X 9x - 6X2 + 5x4 +18X-9 Result: 8x8 - 7x' +14x + 5x+ + 26X+6X - 15

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

Step: 3

blur-text-image

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

MFDBS 91 3rd Symposium On Mathematical Fundamentals Of Database And Knowledge Base Systems Rostock Germany May 6 9 1991

Authors: Bernhard Thalheim ,Janos Demetrovics ,Hans-Detlef Gerhardt

1991st Edition

3540540091, 978-3540540090

More Books

Students also viewed these Databases questions

Question

305 mg of C6H12O6 in 55.2 mL of solution whats the molarity

Answered: 1 week ago