Question: Objectives 1. Understand the design, implementation, usage and limitation of ADT based on fixed- sized arrays. 2. Gain experience implementing abstract data types using already

 Objectives 1. Understand the design, implementation, usage and limitation of ADT
based on fixed- sized arrays. 2. Gain experience implementing abstract data types
using already developed data structures. 3. Gain experience with object-oriented programming abstractions,
especially constructors and operator overloading Overview You will implement and test a
polynomial class, using fixed-sized array as the data structure to store the
terms in a polynomial. Each term in the polynomial is also a
class that you will need to implement. Recall that the general form
of a polynomial is as follows: P(x)=,x' +_-" +...+2x+a, Here, each term
has a coefficient, denoted as a,, and a exponenti, which represent the
power of the variable x. Your polynomial class must implement the following
operations: 1. Addition - given two polynomials P and Ps, compute the
polynomial P, = P + P, 2. Subtraction - given two polynomials
P. and P, compute the polynomial P = P.-P. 3. Multiplication -
given two polynomials P, and P, compute the polynomial P, =P* P,
4. Derivative - given a polynomial P, finds its derivative. 5. Indefinite
integral - given a polynomial P, finds its indefinite integral (anti-derivative). 6.
Definite integral - given a polynomial P, evaluate its definite integral over
an interval [a,b] 7. Degree - given a polynomial P, find its
degree (the largest exponent in any term). 8. Evaluate - given a
polynomial P, evaluate it at value x, to compute y = P(x).
You must first implement the polyterm class, which implements a term in
a polynomial. You will use a fixed-size array to store the terms
in the polynomial, in decreasing order of exponent. Thus, each element in
the array represents a term in the polynomial. The array will have
a maximum size CAPACITY that limits the number of terms that can
be added to the polynomial. are will be a variable, curr_size, that
stores the actual number of terms that are in use in the
olynomial. The terms will be stored in an array of terms called

Objectives 1. Understand the design, implementation, usage and limitation of ADT based on fixed- sized arrays. 2. Gain experience implementing abstract data types using already developed data structures. 3. Gain experience with object-oriented programming abstractions, especially constructors and operator overloading Overview You will implement and test a polynomial class, using fixed-sized array as the data structure to store the terms in a polynomial. Each term in the polynomial is also a class that you will need to implement. Recall that the general form of a polynomial is as follows: P(x)=,x' +_-" +...+2x+a, Here, each term has a coefficient, denoted as a,, and a exponenti, which represent the power of the variable x. Your polynomial class must implement the following operations: 1. Addition - given two polynomials P and Ps, compute the polynomial P, = P + P, 2. Subtraction - given two polynomials P. and P, compute the polynomial P = P.-P. 3. Multiplication - given two polynomials P, and P, compute the polynomial P, =P* P, 4. Derivative - given a polynomial P, finds its derivative. 5. Indefinite integral - given a polynomial P, finds its indefinite integral (anti-derivative). 6. Definite integral - given a polynomial P, evaluate its definite integral over an interval [a,b] 7. Degree - given a polynomial P, find its degree (the largest exponent in any term). 8. Evaluate - given a polynomial P, evaluate it at value x, to compute y = P(x). You must first implement the polyterm class, which implements a term in a polynomial. You will use a fixed-size array to store the terms in the polynomial, in decreasing order of exponent. Thus, each element in the array represents a term in the polynomial. The array will have a maximum size CAPACITY that limits the number of terms that can be added to the polynomial. are will be a variable, curr_size, that stores the actual number of terms that are in use in the olynomial. The terms will be stored in an array of terms called poly terms. For example, if we need to represent the following polynomial: 3x + 2x +1, then the organization of the polynomial class should look like this: CAPACITY 30 curr_size poly_terms LG 4322 ... The dotted lines are meant to convey the fact that each element in the array is an polyferm object with two fields: the coefficient of the term and the exponent to which the variable x should be raised. In the polynomial class, the capacity will be a public constant, whereas the current size and the array of terms will be private members. In your implementation, you cannot store terms containing a coefficient equal to zero. The only exception is the case in which the polynomial correspond to P(x)-0, meaning that the polynomial is just the number 0. When you implement your mathematical operations you must make sure you do not add terms to the polynomial that are zero. Again, the only exception is when the resulting polynomial is the value 0. To clarify, this point consider the following expression: (2x + 1)-(2x - 2). In this case, the resulting polynomial will be 3, and the representation should be: CAPACITY 30 curr size poly_terms As you can see, the terms with variable x cancel out, and there is no need to represent Ox in the polynomial. Likewise, there is no need to represent the term corresponding to X raised to the first power in this polynomial: 2r? + 1 capacity size 2 elements .22 10 In this case, the term corresponding to ar is not represented since the coefficient is zero. Implementation Your implementation will consist of adding CH code to implement two modules: polyterm.cpp and polynomial.cpp. Module: polyterm.cpp This module contains the implementation of the interface for the class used to represent the terms in a polynomial. Public methods to be implemented: . polyterm(double coefficient, unsigned int exponent) - constructor for the polynomial term based on a coefficient and an exponent. double get_coefficient) - Returns the coefficient of this term. unsigned int get_exponent() - Returns the exponent of this term void set_coefficient(double coefficient) - Sets the value of the coefficient for this term. void set_exponent(unsigned int exponent) - Sets the value of the exponent for this term. bool operator (const polyterm& T) - Equality operator. Returns true if both terms have the same exponents and coefficients, or false otherwise. bool operator! (const polyterm& T) - Inequality operator. Returns true if the terms are not equal, or false otherwise. - polyterm operator). Oposite operator. Returns a new term that has a coefficient with the opposite sign of the coefficient in this term. - double operator (double b) - Evaluation operator. Returns the value of the term when the value b is used as the value of the variable x in the term. - polyterm derivative() - computes the derivative of this term. polyterm indefinite integral - computes the indefinite integral (anti-derivative). Module: polynomial.cpp This module contains the implementation of the interface for the polynomial class. Methods to be implemented: - polynomial - Creates a new polynomial with one term set to 0. polynomial(const polyterm& new term) - Creates a new polynomial with one term. const polynomial& operator+(const polynomial& P) - Self-addition operator. Adds the contents of the argument polynomial to the contents of this polynomial. Equivalent expression: PO - PO + Pl; const polynomial& operator-(const polynomial& P) - Self-substraction operator. Substracts the contents of the argument polynomial from the contents of this polynomial. Equivalent expression: PO - PO - P1, where PO is this polynomial. void multiply_term(const polynomial& P, const polyterm& T polynomial& res) - multiplies a polynomial P by a term T, and stores the results in variable res. const polynomial& operator (const polynomial& P) - Self-multiplication operator Multiplies the contents of the argument polynomial with the contents of this polynomial. Equivalent expression: PO = PO P1, where PO is this polynomial. bool operator=(const polynomial& P) - Determines if two polynomial are equal, based on wether or not they have the same terms. unsigned int degree() - Returns the degree of the polynomial, which is the largest exponent of the any term. const polyterm& operator[(int index) - This operator allows access to a term in the polynomial, whose position is given by the argument index. This method must assert whether or not the index is within the bound of the array of terms in the polynomial. double operator(double x) - Evaluates the value of a polynomial, given the value of the variable x. This method evaluates the expression y - Pa), where a is some constant number. polynomial derivative(). This method computes and returns the derivative of a polynomial. You must ensure that the method returns 0 if the polynomial is merely a term with a constant value (e.g. P(x)=2). polynomial indefinite_integral - This method computes the indefinite integral of this polynomial. The method uses the convention that the constant C, used in the expression F(x) + C, will be set to 1. double definite integral(double a, double b) - This method computes the definite integral of this polynomial, on the interval (a,b). polynomial operator+(const polynomial& Pl, const polynomial& P2) - This method adds two polynomials Pl and P2, and returns the result. Equivalent expression: P3 = PIP2 polynomial operator-(const polynomial& P1,const polynomial& P2) - This method substracts two polynomials Pl and P2, and returns the result. Equivalent expression: P3-P1-P2 polynomial operator(const polynomial& PI, const polynomial& P2) - This method multiplies two polynomials Pl and P2, and returns the result. Equivalent expression: P3-P-P2 All operations must ensure that there is enough room to add terms into the resulting polynomials. If not, an assertion should be thrown. You will receive all the .h files necessary for this project. In addition, you will be provided with a main program that uses the polynomial class, and interacts with the user to ask his/her input on the operations and polynomials to be evaluated. Finally, you will be given a Makefile with all the commands needed to compile your project. In summary, your program will consist of the following files: 1. polyterm.h - interface for the polyterm class. 2. polyterm.cpp - implementation of the polyterm class. YOU MUST IMPLEMENT THE METHODS THAT APPEAR IN THIS FILE. 3. polynomial.h - interface for the polynomial class. 4. polynomial.cpp - implementation of the polynomial class. YOU MUST IMPLEMENT THE METHODS THAT APPEAR IN THIS FILE. 5. poly test.cpp - test program for the polynomial class. 6. polymain.cpp-menu-driven main program that interacts with user to perform operations on polynomials. 7. Makefile - the makefile with the commands to compile and submit this project. 8. testl.in - test input file number one. NOTE: YOUR PROGRAM MUST PASS THESE TESTS TO BE CONSIDERED A RUNNING PROGRAM 9. testl.out-expected output from file test1.in 10. test2.in - test input file number two. 11. test2.out - expected output from file test2.out. 12. test3.in - test input file number three. 13. test3.out - expected output from file test3.out. PROJECT DUE DATE: Wednesday, March 4, 2020 Tools Window chego.com/homework-help/questions and answISUULLIVE! File Edit View Project Build Debug Test Analyze 0.08. 2- Extensions Attach.. Help . a (Global Sco parser.cpp - X Miscellaneous Files 1 / *This file name: parser.cc *This file contains the implementation of the parser method which is used to parse the input terms of the polynomial. #include "parser.h" 10 11 Enamespace UT_315 11 Quick and Dirty polynomial parser void parse_error(string err) { cerr Illegal input string: while((str_pos Illegal input string: " + string(str_but); 1/ clear the x if (str_buf[str pos] != '') parse_error(err); else { // clear the x str pos++; Il check if we have a non- value if (str_buf[str_pos) - result - (unsigned int) 1; 87 else 1 clear the + I read the exponent while((str pos 1.0 : -1.0; 13 131 1/ first skip white spaces while((strpos = str_len) { err = "get_term() -> Illegal input string: ".string(str_buf); parse_error(err); 136 139 14 11 first read the coefficient coeff - get_coeff(str_buf, str_pos, str_len); Il correct sign factor coeff factors 142 11 now get the exponent if (str pos astr_len) expo - get expo(str buf, strpos, str len); 146 148 149 else expo = 0; No insues found 90% - O Ready Type here to search (Global Sco parser.cpp = X Miscellaneous Files 142 coeff = factor; 143 1/ now get the exponent 145 if (str_pos #include #include "polynomial.h" Eusing namespace std; using namespace UT_315; 16 Fint main(){ polynomial P1, P2, P3, P4, P6; 18 cout > P8; cout > P9; cout #include #include "polynomial.h" #include "polymain.h" Busing namespace std; using namespace UT_315; XXXWWWXXNXXNNNXB e int main int opt; cout > data_in; cin.getline(s, 1924); if (date_in -- "1) return POLY ADO; 88 else if (date_in - return POLY_SUBS; "2") else if (data in return POLY_JULT; "3") else if (data in = 4) return POLY_DERIVE; else if (data in . g.) return POLY_INDEF_INT; 905 - D Ready No istues found x Activid. x C Search X C includ x c This Is Need auto) chegg.com/homework-help/questions-and-answers/objectives-1-understand-design-implementation-u. A File Edit View Project Build Debug Test Analyze Tools Extensions Window Help 0.08. 2- Attach... . . (Global Scop polymain.cpp + X Miscellaneous Files 112 cout > P1; cout > P2; cout > P1; cout > P2; cout > P1 cout > P2; cout > P: cout > P; 161 cout > P; cout > a; cout > b; cout > P; cout > P; cout > a; cout > P; cout > a; cout > P; cout include #include #include #include "polyterm.h" #include "polynomial.h" #include "parser.h" Enamespace UT_315 1/ DO NOT MODIFY THE NEXT FUNCTIONS E . This method reads the polynomial from the terminal or screen. istream& operator>>(istream in, polynomial& P) P.clear(); parser(in, P); return in; void expo_out(ostreak out, unsigned int expo) if (expo > (unsigned int) 0) if (expo - (unsigned int) 1){ cout include "polytern.h" namespace UT_315 * Let's define the constant constants for integration. that will be used to express the NNNNNNOR #define C 1 - Utility macro used to determine the maximum between two numbers #define max(x,y) (x + y ) x: y) Utility macro used to determine the manimum between two numbers. define sin(x,y) (x + y ? x y). Polynomial class interface class polynomial public: 11 maxim polynomial capacity definition typedef std: size_t site type; static const size_type CAPACITY = 20; 11 constructors polynomial(); 90% - O Ready No issues found Attach... + polynomialh + x Miscellaneous Files static const size_type CAPACITY = 20; 7/ constructors polynomial(); polynomial(const polyterm& the_term); 11 Assigment operators const polynomial& operator+=(const polynomial& P); const polynomial& operator-=(const polynomial& P); const polynomial& operator+(const polynomial& P); 11 Equality operators bool operator (const polynomial& P) const; 1/ Constant member functions unsigned int degree() const; size_type size() const {return curr_size;}; const polyterms operator[](int index) const; double operator (double x) const; polynomial derivative() const; polynomial indefinite_integral() const; double definite_integral(double a, double b) const; friend ostream& operator>(istream& in, polynomial& P); friend void parser(istreams in, polynomial& P); private: 1 Data Members polytere poly_terms[CAPACITY]; // the terms of the polynomial size_type curr_size; // the current number of terms Il Private methods void set_ter(int term, const polyterm new_tera); void incr_size() (curr_size;); void clear) (curr_size= ; ); vold wultiply term(const polynomials P. const polytern polynomials res) B3 05 Il Nonnenber functions for polynomials polynomial operator+(const polynomials P1, const polynomials P2); polyno dal operator (const polynomials Pi, const polynomial& P2); polynomial operator+(const polynomials P1, const polynomialg P2); 90% - Nowues found Ready chegg.com/homework-help/questions and answers/objectives 1-understand-design-implemental File Edit View Project Build Debug Test Analyze Tools Extensions Window He 0.08. 28 Attach... - @ polynomial h = X Miscellaneous Files (Globa friend void parser(istream& in, polynomial& P); private: 7/ Data Members polyterm poly_terms[CAPACITY); // the terms of the polynomial size_type curr_size; // the current number of terms 1/ Private methods void set_term(int term, const polyterm& new_term); void incr_size() {curr_size++; }; void clear() {curr_size = ; ); void multiply_term(const polynomial& P, const polyterm& T, polynomial& res); 1: 1/ Normenber functions for polynomials polynomial operator+(const polynomial& P1, const polynomialg P2); polynomial operator-(const polynomialg P1, const polynomial& P2); polynomial operator*(const polynomial& P1, const polynomial& P2); Sendif No issues found Ready Activid. X C Search e chegg.com/homework-help/questions-and-answers/objectives-1-understand-desig File Edit View Project Build Debug Test Analyze Tools Extensions 0.0 3. 2 . Attach... polyterm.cpp - X Miscellaneous Files Student Information Goes HERE *This file name: polyterm.cpp MAA *This file contains the implementation of the polynomial term Etinclude #include #include "polyterm.h" Enamespace UT 315 1 ADD YOUR CODE HERE IT TO IMPLEMENT THE METHODS IN THE 1/ POLYTERM CLASS DC File Edit View Project DU DU Attach... polyterm. h x Miscellaneous Files *This file name: polyterm.h *This file contains the declaration of the interface for * the class used to represent the terms in a polynomial. Ovo #ifndef _POLYTERM_H #define _POLYTERM H #include #include #include 17 Get to use the standard C++ name space using namespace std; // Declare the name space for the course namespace UT_3154 GENN * Interface for the class representing a term in polynomial. class polyterm { public: // Default constructor polytern(double coefficiente, unsigned int exponent=0) { coeff - coefficient; expo - exponent; 1/Accessor methods 1/ Returns the coefficient of this term double get_coefficient() const return coeff; 1/ Returns the exponent of this term unsigned int get exponent() const { return expo; 1/ Mutators methods 11 Sets the value of the coefficient for this term void set coefficient (double coefficient) coet+ - coefficient; 50 90 % - No issues found Ready File Edit View Project Build Debug Test Extensions Window Analyze Tools Attach... - polytermh + X Miscellaneous Files return expo; . (Glob // Mutators methods // Sets the value of the coefficient for this term void set_coefficient(double coefficient){ coeff = coefficient; // Sets the value of the exponent for this term void set_exponent(unsigned int exponent) { expo = exponent; 99 $SSSS98% 4XUSB 1/ Other member functions // Equality operator. Returns true if both terms have the 1/ same exponents and coefficients, or false otherwise. bool operator (const polyter & T) const; 1/ Inequality operator. Returns true the terms are not 1/ equal, or false otherwise. bool operatori(const polyterm& T) const; 1/ Oposite operator. Returns a new term that has a 1/ coefficient with the opposite sign of the coefficient in this term. polyter operator-o const; 1/ Evaluation operator. Returns the value of term when 1/ b is used as the value of the variable in the term. double operator (double b) const; 1/ Derivative function polyters derivative() const; 1 Indefinite Integral Function polyter indefinite_integral() const; private: double coeff; // The coefficient of the term unsigned int expo; // The exponent of the term Il Non- ber overloaded operators 11 Addition operator between two terms polyter operator (const polyter Ti, const polyter Strationerate between twater No es found T2); - Ready Attach... - o.o . polyterm.h - X Miscellaneous Files 1/ Oposite operator. Returns a new term that has a 77 coefficient with the opposite sign of the coefficient 11 in this term. polyterm operator-() const; 71 Evaluation operator. Returns the value of term when 11 bis used as the value of the variable in the term. double operator (double b) const; // Derivative function polyterm derivative() const; 7/ Indefinite Integral Function polytern indefinite_integral() const; private: double coeff; // The coefficient of the term unsigned int expo; // The exponent of the term I/ Non-member overloaded operators // Addition operator between two terms polyter operator+(const polyterm& Ti, const polyterm& T2); 1/ Substraction operator between two terms polyterm operator-(const polyterm& Ti, const polyter & T2); 1/ Multiplication operator between two terms polyter operator(const polyter & Ti, const polyterm& T2); #endit 90 % - No SSS Objectives 1. Understand the design, implementation, usage and limitation of ADT based on fixed- sized arrays. 2. Gain experience implementing abstract data types using already developed data structures. 3. Gain experience with object-oriented programming abstractions, especially constructors and operator overloading Overview You will implement and test a polynomial class, using fixed-sized array as the data structure to store the terms in a polynomial. Each term in the polynomial is also a class that you will need to implement. Recall that the general form of a polynomial is as follows: P(x)=,x' +_-" +...+2x+a, Here, each term has a coefficient, denoted as a,, and a exponenti, which represent the power of the variable x. Your polynomial class must implement the following operations: 1. Addition - given two polynomials P and Ps, compute the polynomial P, = P + P, 2. Subtraction - given two polynomials P. and P, compute the polynomial P = P.-P. 3. Multiplication - given two polynomials P, and P, compute the polynomial P, =P* P, 4. Derivative - given a polynomial P, finds its derivative. 5. Indefinite integral - given a polynomial P, finds its indefinite integral (anti-derivative). 6. Definite integral - given a polynomial P, evaluate its definite integral over an interval [a,b] 7. Degree - given a polynomial P, find its degree (the largest exponent in any term). 8. Evaluate - given a polynomial P, evaluate it at value x, to compute y = P(x). You must first implement the polyterm class, which implements a term in a polynomial. You will use a fixed-size array to store the terms in the polynomial, in decreasing order of exponent. Thus, each element in the array represents a term in the polynomial. The array will have a maximum size CAPACITY that limits the number of terms that can be added to the polynomial. are will be a variable, curr_size, that stores the actual number of terms that are in use in the olynomial. The terms will be stored in an array of terms called poly terms. For example, if we need to represent the following polynomial: 3x + 2x +1, then the organization of the polynomial class should look like this: CAPACITY 30 curr_size poly_terms LG 4322 ... The dotted lines are meant to convey the fact that each element in the array is an polyferm object with two fields: the coefficient of the term and the exponent to which the variable x should be raised. In the polynomial class, the capacity will be a public constant, whereas the current size and the array of terms will be private members. In your implementation, you cannot store terms containing a coefficient equal to zero. The only exception is the case in which the polynomial correspond to P(x)-0, meaning that the polynomial is just the number 0. When you implement your mathematical operations you must make sure you do not add terms to the polynomial that are zero. Again, the only exception is when the resulting polynomial is the value 0. To clarify, this point consider the following expression: (2x + 1)-(2x - 2). In this case, the resulting polynomial will be 3, and the representation should be: CAPACITY 30 curr size poly_terms As you can see, the terms with variable x cancel out, and there is no need to represent Ox in the polynomial. Likewise, there is no need to represent the term corresponding to X raised to the first power in this polynomial: 2r? + 1 capacity size 2 elements .22 10 In this case, the term corresponding to ar is not represented since the coefficient is zero. Implementation Your implementation will consist of adding CH code to implement two modules: polyterm.cpp and polynomial.cpp. Module: polyterm.cpp This module contains the implementation of the interface for the class used to represent the terms in a polynomial. Public methods to be implemented: . polyterm(double coefficient, unsigned int exponent) - constructor for the polynomial term based on a coefficient and an exponent. double get_coefficient) - Returns the coefficient of this term. unsigned int get_exponent() - Returns the exponent of this term void set_coefficient(double coefficient) - Sets the value of the coefficient for this term. void set_exponent(unsigned int exponent) - Sets the value of the exponent for this term. bool operator (const polyterm& T) - Equality operator. Returns true if both terms have the same exponents and coefficients, or false otherwise. bool operator! (const polyterm& T) - Inequality operator. Returns true if the terms are not equal, or false otherwise. - polyterm operator). Oposite operator. Returns a new term that has a coefficient with the opposite sign of the coefficient in this term. - double operator (double b) - Evaluation operator. Returns the value of the term when the value b is used as the value of the variable x in the term. - polyterm derivative() - computes the derivative of this term. polyterm indefinite integral - computes the indefinite integral (anti-derivative). Module: polynomial.cpp This module contains the implementation of the interface for the polynomial class. Methods to be implemented: - polynomial - Creates a new polynomial with one term set to 0. polynomial(const polyterm& new term) - Creates a new polynomial with one term. const polynomial& operator+(const polynomial& P) - Self-addition operator. Adds the contents of the argument polynomial to the contents of this polynomial. Equivalent expression: PO - PO + Pl; const polynomial& operator-(const polynomial& P) - Self-substraction operator. Substracts the contents of the argument polynomial from the contents of this polynomial. Equivalent expression: PO - PO - P1, where PO is this polynomial. void multiply_term(const polynomial& P, const polyterm& T polynomial& res) - multiplies a polynomial P by a term T, and stores the results in variable res. const polynomial& operator (const polynomial& P) - Self-multiplication operator Multiplies the contents of the argument polynomial with the contents of this polynomial. Equivalent expression: PO = PO P1, where PO is this polynomial. bool operator=(const polynomial& P) - Determines if two polynomial are equal, based on wether or not they have the same terms. unsigned int degree() - Returns the degree of the polynomial, which is the largest exponent of the any term. const polyterm& operator[(int index) - This operator allows access to a term in the polynomial, whose position is given by the argument index. This method must assert whether or not the index is within the bound of the array of terms in the polynomial. double operator(double x) - Evaluates the value of a polynomial, given the value of the variable x. This method evaluates the expression y - Pa), where a is some constant number. polynomial derivative(). This method computes and returns the derivative of a polynomial. You must ensure that the method returns 0 if the polynomial is merely a term with a constant value (e.g. P(x)=2). polynomial indefinite_integral - This method computes the indefinite integral of this polynomial. The method uses the convention that the constant C, used in the expression F(x) + C, will be set to 1. double definite integral(double a, double b) - This method computes the definite integral of this polynomial, on the interval (a,b). polynomial operator+(const polynomial& Pl, const polynomial& P2) - This method adds two polynomials Pl and P2, and returns the result. Equivalent expression: P3 = PIP2 polynomial operator-(const polynomial& P1,const polynomial& P2) - This method substracts two polynomials Pl and P2, and returns the result. Equivalent expression: P3-P1-P2 polynomial operator(const polynomial& PI, const polynomial& P2) - This method multiplies two polynomials Pl and P2, and returns the result. Equivalent expression: P3-P-P2 All operations must ensure that there is enough room to add terms into the resulting polynomials. If not, an assertion should be thrown. You will receive all the .h files necessary for this project. In addition, you will be provided with a main program that uses the polynomial class, and interacts with the user to ask his/her input on the operations and polynomials to be evaluated. Finally, you will be given a Makefile with all the commands needed to compile your project. In summary, your program will consist of the following files: 1. polyterm.h - interface for the polyterm class. 2. polyterm.cpp - implementation of the polyterm class. YOU MUST IMPLEMENT THE METHODS THAT APPEAR IN THIS FILE. 3. polynomial.h - interface for the polynomial class. 4. polynomial.cpp - implementation of the polynomial class. YOU MUST IMPLEMENT THE METHODS THAT APPEAR IN THIS FILE. 5. poly test.cpp - test program for the polynomial class. 6. polymain.cpp-menu-driven main program that interacts with user to perform operations on polynomials. 7. Makefile - the makefile with the commands to compile and submit this project. 8. testl.in - test input file number one. NOTE: YOUR PROGRAM MUST PASS THESE TESTS TO BE CONSIDERED A RUNNING PROGRAM 9. testl.out-expected output from file test1.in 10. test2.in - test input file number two. 11. test2.out - expected output from file test2.out. 12. test3.in - test input file number three. 13. test3.out - expected output from file test3.out. PROJECT DUE DATE: Wednesday, March 4, 2020 Tools Window chego.com/homework-help/questions and answISUULLIVE! File Edit View Project Build Debug Test Analyze 0.08. 2- Extensions Attach.. Help . a (Global Sco parser.cpp - X Miscellaneous Files 1 / *This file name: parser.cc *This file contains the implementation of the parser method which is used to parse the input terms of the polynomial. #include "parser.h" 10 11 Enamespace UT_315 11 Quick and Dirty polynomial parser void parse_error(string err) { cerr Illegal input string: while((str_pos Illegal input string: " + string(str_but); 1/ clear the x if (str_buf[str pos] != '') parse_error(err); else { // clear the x str pos++; Il check if we have a non- value if (str_buf[str_pos) - result - (unsigned int) 1; 87 else 1 clear the + I read the exponent while((str pos 1.0 : -1.0; 13 131 1/ first skip white spaces while((strpos = str_len) { err = "get_term() -> Illegal input string: ".string(str_buf); parse_error(err); 136 139 14 11 first read the coefficient coeff - get_coeff(str_buf, str_pos, str_len); Il correct sign factor coeff factors 142 11 now get the exponent if (str pos astr_len) expo - get expo(str buf, strpos, str len); 146 148 149 else expo = 0; No insues found 90% - O Ready Type here to search (Global Sco parser.cpp = X Miscellaneous Files 142 coeff = factor; 143 1/ now get the exponent 145 if (str_pos #include #include "polynomial.h" Eusing namespace std; using namespace UT_315; 16 Fint main(){ polynomial P1, P2, P3, P4, P6; 18 cout > P8; cout > P9; cout #include #include "polynomial.h" #include "polymain.h" Busing namespace std; using namespace UT_315; XXXWWWXXNXXNNNXB e int main int opt; cout > data_in; cin.getline(s, 1924); if (date_in -- "1) return POLY ADO; 88 else if (date_in - return POLY_SUBS; "2") else if (data in return POLY_JULT; "3") else if (data in = 4) return POLY_DERIVE; else if (data in . g.) return POLY_INDEF_INT; 905 - D Ready No istues found x Activid. x C Search X C includ x c This Is Need auto) chegg.com/homework-help/questions-and-answers/objectives-1-understand-design-implementation-u. A File Edit View Project Build Debug Test Analyze Tools Extensions Window Help 0.08. 2- Attach... . . (Global Scop polymain.cpp + X Miscellaneous Files 112 cout > P1; cout > P2; cout > P1; cout > P2; cout > P1 cout > P2; cout > P: cout > P; 161 cout > P; cout > a; cout > b; cout > P; cout > P; cout > a; cout > P; cout > a; cout > P; cout include #include #include #include "polyterm.h" #include "polynomial.h" #include "parser.h" Enamespace UT_315 1/ DO NOT MODIFY THE NEXT FUNCTIONS E . This method reads the polynomial from the terminal or screen. istream& operator>>(istream in, polynomial& P) P.clear(); parser(in, P); return in; void expo_out(ostreak out, unsigned int expo) if (expo > (unsigned int) 0) if (expo - (unsigned int) 1){ cout

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!