-
Polynomial Class
I am doing my another computer project.....
have a problem.......:'(
It's about making a class "Polynomial"
Follwing:
-Create a class Poly to represent POLYNOMIALS of x
(for example x^3+3x^2+2)
-Overload operators +,-,*
-You must not use any cin or cout.......
Please help me.......:'(
-
You can start by doing a search of the board. To do that click on the little blue button in the upper right hand of the client area of this programs window. Then enter the word polynomial in the search edit box and click go. Set back and be amazed at the results a few seconds before clicking on any of the proffered listings.
As startes I suggest you consider developing several classes, including a term class and a polynomial class. The term class would hold a coefficient, a base, a power, and (maybe, depending how you design polynomial class) a pointer to class (so you can use the term class as a node in a list if you wish). The polynomialclass would contain a container of terms (here you could use an array, or list, or vector, or stack or whatever), and a series of methods to group like terms, do multiplication of two polynomials, or display a polynomial, etc.
Now after reading several of the posts found in your search, and my brief sketch, sit down with a pencil and paper, write out your program in English (or whatever your native language is), and then, and only then think about writing out the code.