You are viewing a single comment's thread from:
RE: Coding Challenge #2 – Polynomial
I understand it like this:
- you get a polynomial (like described) and parse it.
- implement functions 'add', 'subtract', ... etc.
- implement toString() method (to see the result of implemented operations).
Am I correct on this one?
So, does it come with a second input to plug in for x, then?
@bandli is correct. You get a string representation of a polynomial and should implement a class that parses that and allows to fo math with it:
If you want to have an
evaluate
method that could be fun tooIt might help a lot if you have one or two examples like this in your post, so we can include them in our test cases. It makes understanding the problem at hand a bit easier. In the real world I would say "specifications unclear" and send it back to the Product Owner ;)
You are right! I wanted to post it and probably should have refined the specification a bit before that. Next challenge I'll see to make up to that
Oh! You want us to create a polynomial class and return an object of that given polynomial! Is that it?
I want you to create a polynomial class that has a constructor accepting a string :)