| | |
class polynomial
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2004
Posts: 7
Reputation:
Solved Threads: 0
Hi i'd be glad if u help me with write this program.
i want to write a polynomial program which it has a class that create 2 obj like this with useing linked list: (Ax^2y^3+Bx^4y^8+....)AND(ax^5y^1+....)
and after that multiply these 2 obj to each other and put the answer in the new linklist.(a is float and exponents are int )
i should overdoal << , >> , = , * ,(i,j)
HELP:this >> should be overloaded like this:for example we should inter
(Ax2y3+Bx4y8+...) AND (ax5y1+...)
(and wen we overload this we read first and ignore (1),again read again ignore with for loop up to finished all off them ...maybe when we push the inter key or when we see the null )
this * should overloaded like :{a1=(A*a) ,,, exp1=2+5 ,,, exp2=3+1 }and so on whith for loop....and also we should compare these new linklist exponents if some of them are the same ,then add their float part of them.
this = should overloaded like :after create the new linklist by * the 2 obj we should put them in new plase with this operator.
this (i,j) should overloaded like : after all we send i and j to the new linklist and after that x=i,,,y=j ,then we get the answer .
this << should overloaded like : again after create the new link list we shout cout it .... for example {(A*a)x7y4+...}
ok , thanks 4 reading this message and plz help me with this program.
lida
i want to write a polynomial program which it has a class that create 2 obj like this with useing linked list: (Ax^2y^3+Bx^4y^8+....)AND(ax^5y^1+....)
and after that multiply these 2 obj to each other and put the answer in the new linklist.(a is float and exponents are int )
i should overdoal << , >> , = , * ,(i,j)
HELP:this >> should be overloaded like this:for example we should inter
(Ax2y3+Bx4y8+...) AND (ax5y1+...)
(and wen we overload this we read first and ignore (1),again read again ignore with for loop up to finished all off them ...maybe when we push the inter key or when we see the null )
this * should overloaded like :{a1=(A*a) ,,, exp1=2+5 ,,, exp2=3+1 }and so on whith for loop....and also we should compare these new linklist exponents if some of them are the same ,then add their float part of them.
this = should overloaded like :after create the new linklist by * the 2 obj we should put them in new plase with this operator.
this (i,j) should overloaded like : after all we send i and j to the new linklist and after that x=i,,,y=j ,then we get the answer .
this << should overloaded like : again after create the new link list we shout cout it .... for example {(A*a)x7y4+...}
ok , thanks 4 reading this message and plz help me with this program.

lida
Have you written anything yourself? Please read the Announcement regarding homework.
Alex Cavnar, aka alc6379
write a basic class and post it up with some comments as im a bit unsure as to exactly what you want to do with it, and i dont understand the polynomial of you ideally want a basic list of a polynomial like this
Ax + Bx^2 + Cx^3.... which can be combined to form pretty much anything (check out "Maclaurin's Series" -> it is EXTREMEMLY USEFUL for polynomial workings)
As a hint you want a "member/term" class for each term (x, x^2) with a co-eff and a power and then make a list of them, with the power being equal to the index in the list
ie.
class term
{
float co_efficient;
float power; (or int)
};
then the list would be like:
term x0 (power = 0) -> term x1 (power = 1) -> term x2 (power = 2) ect....
good luck with it!
•
•
•
•
(Ax^2y^3+Bx^4y^8+....)
Ax + Bx^2 + Cx^3.... which can be combined to form pretty much anything (check out "Maclaurin's Series" -> it is EXTREMEMLY USEFUL for polynomial workings)
As a hint you want a "member/term" class for each term (x, x^2) with a co-eff and a power and then make a list of them, with the power being equal to the index in the list
ie.
class term
{
float co_efficient;
float power; (or int)
};
then the list would be like:
term x0 (power = 0) -> term x1 (power = 1) -> term x2 (power = 2) ect....
good luck with it!
http://sales.carina-e.com
no www
no nonsense
coming soon to a pc near you! :cool:
no www
no nonsense
coming soon to a pc near you! :cool:
![]() |
Similar Threads
- Polynomial Puppeting (C++)
- Can anyone help me with adding 2 polynomials together? (C++)
- Need help in my C++ Assignment (C++)
- help with polynomials (C++)
Other Threads in the C++ Forum
- Previous Thread: help compiling
- Next Thread: HELP! Illegal Character Constant in a Console Application
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






