Design and implement a class that is a class for polynomials. The polynomial anxn + an-1xn-1 +...+a0 will be implemented as a linked list. Each node will contain an int value for the power of x and an int value for the corresponding coefficient. The class operations should include addition, subtraction, multiplication, and evaluation of a polynomial. Overload the operators +, -, and * for addition, subtraction, and multiplication. Evaluation of a polynomial is implemented as a member function with one argument of type int. The evaluation member function returns the value obtained by plugging in its argument for x and performing the indicated operations.Include four constructors: a default constructor, a copy constructor, a constructor with a single argument of type int that produces the polynomial that has only one constant term that is equal to the constructor argument, and a constructor with two arguments of type int that produces the one-term polynomial whose coefficient and exponent are given by the two arguments. (In the previous notation, the polynomial produced by the one-argument constructor is of the simple form consisting of only a0. The polynomial produced by the two-argument constructor is of the slightly more complicated form anxn.) Include a suitable destructor. Include member functions to input and output polynomials.When the user inputs a polynomial, the user types in the following:anx^n + an-1x^n-1+...+a0

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
icon
Related questions
Question

Design and implement a class that is a class for polynomials. The polynomial

anxn + an-1xn-1 +...+a0

will be implemented as a linked list. Each node will contain an int value for the power of x and an int value for the corresponding coefficient. The class operations should include addition, subtraction, multiplication, and evaluation of a polynomial. Overload the operators +, -, and * for addition, subtraction, and multiplication. Evaluation of a polynomial is implemented as a member function with one argument of type int. The evaluation member function returns the value obtained by plugging in its argument for x and performing the indicated operations.
Include four constructors: a default constructor, a copy constructor, a constructor with a single argument of type int that produces the polynomial that has only one constant term that is equal to the constructor argument, and a constructor with two arguments of type int that produces the one-term polynomial whose coefficient and exponent are given by the two arguments. (In the previous notation, the polynomial produced by the one-argument constructor is of the simple form consisting of only a0. The polynomial produced by the two-argument constructor is of the slightly more complicated form anxn.) Include a suitable destructor.

Include member functions to input and output polynomials.
When the user inputs a polynomial, the user types in the following:
anx^n + an-1x^n-1+...+a0

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Linked List Representation
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.
Similar questions
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education