I need to write a declaration for a polynomial class where data members are an integer for the degree and an array for for the list of coefficients and with basic operations of input and output....and then implement the input operation....

Here is what I have

class Polynomial
{
public:

list1 (int degree = 100)

int list2 []
}

There is a chance I have no idea what I am doing so just thought that I could just at least start with something

Recommended Answers

All 6 Replies

Do something like this :

class Polynomial{
 private:
 std::vector<int> coeff; //the coefficiants
 public:
 void getInput();
 void printPolynomial();
}

its pretty much similar to yours except I use a vector instead of raw arrays.
Now just implement the input and output functions.

There is a chance I have no idea what I am doing so just thought that I could just at least start with something

Compile it and find out for sure whether you have any idea of what you are doing. Report the errors in your post.

Does it compile? No? Then drop what you are doing and take a tutorial on classes and how they work, then come back and tackle the assignment.

http://www.cplusplus.com/doc/tutorial/classes/

to vernondozier. please do not post to any questions I ask. I am sick and tired of you running your mouth and being so damn rude over the internet. I hate c++ and just struggling to get through it so please just leave my posts alone. To everyone else that has helped me through these questions thank you very much but to the other please piss off. The comments you make are not necessary.

Thank you firstperson I appreciate the help. The only problem is we are required to use an array so need to find a way for this to work

to vernondozier. please do not post to any questions I ask. I am sick and tired of you running your mouth and being so damn rude over the internet.

The comments you make are not necessary.

Nope. I'm not being rude and the comments are totally necessary. I'm telling you what you need to do. You are a chronic homework dumper who clearly doesn't read tutorials before posting. I've given you some damn good advice on a lot of threads.

Look at this last one for instance:

http://www.daniweb.com/forums/thread268221.html

Find me anyone else on this forum who would go through a thousand lines of code and answer your questions. You're welcome by the way. I don't know why I bother and at your request, I won't anymore. And again, you're welcome. I spent a lot of time answering those questions. Not that you +repped me or anything like that.

You need to get a much thicker skin. I've gone over a lot of your other threads. People inevitably get fed up with you and then you ask anyone but them to help you or you swear, then apologize to the forum, or then you get mad at them, then apologize, then thank them. It's a pattern.

If you want to know how forums work, read this. The whole thing.
http://catb.org/~esr/faqs/smart-questions.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.