954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

class polynomial

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

lida1984
Newbie Poster
7 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

Have you written anything yourself? Please read the Announcement regarding homework .

alc6379
Cookie... That's it
Team Colleague
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
 

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 (Ax^2y^3+Bx^4y^8+....) 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! :)

1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
 

hi plzzzzz help me!!!!!!

lida1984
Newbie Poster
7 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 
hi plzzzzz help me!!!!!!


Posting more than 0 lines of code will definitely help.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

dont you have ANY idea where to start?!?!?!? i have given some hints....

1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You