|
-
Jun 1st, 2001, 02:12 PM
#1
Thread Starter
New Member
Polynomial class?
Hello everybody,
I hope somebody here can help me out. I got a program to do for class but for some reasion I just can't put it togther. For those of you with C++ How to Program book third edition by Deitel & Deitel its Ex 8.19 p575...
Those without the book here is the question:
Develop class Polynomial. This internal representation of a Polynomial is an array of terms. Each term contains a coefficient and an exponent. The term
2x^4
has a coefficient of 2 and an exponent of 4. Develop a full class containing proper constructor and destructor functions as well as set and get functions. The class should also provide the following overloaded operator capabilities:
1. Overload the addition operator (+) to add two Polynomials.
2. Overload the subtraction operator (-) to subtract two Polynomials.
3. Overload the assignment operator to assign one Polynomial to another.
4. Overload the multiplication operator (*) to multiply two Polynomials.
5. Overload the addition assignment operator (+=), the subtraction assignment operator (-=), and the multiplication assignment operator (*=).
well people I just can't put my head into this. any help is apresiated... hints examples anything... and if your free I really need it during these next couple of days...
Thanks in advance for any help......
-
Jun 1st, 2001, 09:01 PM
#2
Member
Check out this page...
http://www.planet-source-code.com/xq...s/ShowCode.htm
http://turing.gcsu.edu/~gadkins1/poly.html
and do a search for "c++ classes" and "operator overloading" on a site like google.
chilibean
Last edited by chilibean; Jun 1st, 2001 at 09:12 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|