Develop class Polynomial. The internal representation of a Polynomial is an array of terms. Each term contains a coefficient and an exponent, e.g., the term 2?2 has the coefficient 2 and the exponent 2 and the term 3? has coefficient 3 and exponent 1. Develop a complete class that has private attributes of coefficient and exponent and that provides the following overloaded operator capabilities: • Overload the addition operator (+) to add two Polynomials • Overload the subtraction operator (-) to subtract two Polynomials. • Overload the multiplication operator (*) to multiply two Polynomials. • Overload the assignment operator (=) to assign one Polynomial to another. • Overload the equal operator (==) to check that two Polynomials are equal or not. • Overload the pre and post increment and decrement operators.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Develop class Polynomial. The internal representation of a Polynomial is an array of terms. Each term contains a coefficient and an exponent, e.g., the term 2?2 has the coefficient 2 and the exponent 2 and the term 3? has coefficient 3 and exponent 1. Develop a complete class that has private attributes of coefficient and exponent and that provides the following overloaded operator capabilities:
• Overload the addition operator (+) to add two Polynomials
• Overload the subtraction operator (-) to subtract two Polynomials.
• Overload the multiplication operator (*) to multiply two Polynomials.
• Overload the assignment operator (=) to assign one Polynomial to another.
• Overload the equal operator (==) to check that two Polynomials are equal or not.
• Overload the pre and post increment and decrement operators.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps