Question: write C++ classes to represent and work with polynomials. The specific implementation details are up to you, but you must use the names and

write C++ classes to represent and work with polynomials. The specific implementation details are up to you, 

write C++ classes to represent and work with polynomials. The specific implementation details are up to you, but you must use the names and method signatures given in the requirements and you should utilize good object-oriented design principles. Your code should compile with no warnings. 1. term.cpp/hpp: Create a class called Term which has the following attributes: coefficient (int) variable (string) exponent (int) and at least the following methods: an appropriate constructor. The default term should be Ox toString()-returns a string representation of the term Any mutator/accessor methods you feel appropriate 2. polynomial.cpp/hpp: Create a class called Polynomial which stores an arbitrary number of Term objects using one of the C++ STL container classes. An appropriate constructor and (if necessary) destructor void add (Term t) - add a Term to the polynomial void print () - neatly print the polynomial Polynomial combineLikeTerms ()-returns a new polynomial that is the result of combining the like terms in the polynomial any other methods you see fit to implement 3. Your code should work with the provided project2.cpp file. Print your name at the start and end of your program's output. I suggest using the provided makefile.

Step by Step Solution

3.49 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres an example implementation of the described classes in C The implementation includes a Term class and a Polynomial class The code is split into three files termhpp termcpp and polynomialhpp The p... View full answer

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 Operating System Questions!