GetDotted Domains

Viewing Thread:
"Good at C++ ? In here please!"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Sat 24/04/04 at 12:01
Regular
"Sure.Fine.Whatever."
Posts: 9,629
Anyone here good at C++ ?

If so, I may need your help a bit in the next couple of days, it may help if you are immune to a guilty conscience!
Sat 24/04/04 at 22:03
Regular
Posts: 2,849
A hand yes, but not the head, two legs, body and arms as well.
Sat 24/04/04 at 21:53
Regular
"smile, it's free"
Posts: 6,460
I would have given a hand but Kernel's already given you the answer there :)
Sat 24/04/04 at 21:09
Regular
"Sure.Fine.Whatever."
Posts: 9,629
Lol, and tut tut :D
Sat 24/04/04 at 21:08
Regular
"relocated"
Posts: 2,833
No problem. In a sad way I enjoyed it, mainly because I should have been doing something else.
Sat 24/04/04 at 21:06
Regular
"Sure.Fine.Whatever."
Posts: 9,629
Thanks for the tips AliBoy, and cheers again kernal! Its starting to come together a bit now!
Sat 24/04/04 at 20:56
Regular
"relocated"
Posts: 2,833
Icaruss wrote:
> The Java version looks a lot less complicated :o)

Heh, that's Java for you. Or possibly my bad coding. The actual maths bit was pretty simple though, it's just formatting it for output to screen that looks messy.

I read the question again and my solution doesn't actually do everything it's supposed to - I didn't notice the '+ K' bit and so it doesn't deal with that. The question does seem to suggest that forming an array from the input is in one of the tutorial solutions so it shouldn't be too hard to adapt it.

Edit: just realised that this makes me look quite sad. I'm only staying in on a saturday doing C++ because I'm not feeling well. I swear!
Sat 24/04/04 at 18:50
Regular
"Picking a winner!"
Posts: 8,502
Be sure to add comments for the tricky looking parts of it though as code with no comments is pants.

Be sure you know what each bit does too just incase they decide to ask you why you used certain code or "what does this line do?"
Sat 24/04/04 at 18:07
Regular
Posts: 2,849
The Java version looks a lot less complicated :o)
Sat 24/04/04 at 18:04
Regular
"SOUP!"
Posts: 13,017
unknown kernel wrote:
> int polynomial[11];
> int derivative[10];
> int So if your polynomial was 4
> + 3x + 3x^2 + 4X^10 then the array polynomial should be
> [4,3,3,0,0,0,0,0,0,0,4]
> for (i=0; i<11; i++)
> cout << "Input coefficient for the X^" << i
> << " term: ";
> cin >polynomial[i];
> for (i=1; i<11; i++) //The first item in the polynomial is
> discarded so you start with i=1, the second element.
> derivative[i-1] = polynomial[i] * i
> for (i=0; i<10; i++)
> if (i==0)
> {cout << derivative[i]<< "
> ";}
> else
> if (derivative[i] < 0)
> {cout << derivative[i] <<
> "X^" << i << " ";}
> if (derivative[i] 0)
> {cout << "+" <<
> derivative[i] << "X^" << i << "
> If the polynomial you input is 4 + 3x + 3x^2 + 4X^10 then this gives
> you an output of 3 +6X^1 +40X^9, which if I remember my maths is what
> it should be :)

*head explodes*

The only bit I understand is the If statement.
Sat 24/04/04 at 18:02
Regular
"Sure.Fine.Whatever."
Posts: 9,629
My Uni couldnt be arsed!

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Wonderful...
... and so easy-to-use even for a technophobe like me. I had my website up in a couple of hours. Thank you.
Vivien
I've been with Freeola for 14 years...
I've been with Freeola for 14 years now, and in that time you have proven time and time again to be a top-ranking internet service provider and unbeatable hosting service. Thank you.
Anthony

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.