I need help with this exercise, its very important for my final in two days.
I have skipped alot of classes and im not sure what to do, if anyone can help me step by step all the way.
Please note, that it is not a homework site. We won't do your homework for you. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.
We didn't see your attemts to solve this youself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again. As it is impossible to find deriviative of function without knowledge in ariphmetics, you cannot do more complex tasks in programming without clear understanding of basics
Well, I do have the books answer but it keeps giving me incorrect whenever I compile it.
It's not that big of a deal to ask for a solution for a problem that isn't even solved in the book.
Describe the research you did to try and understand the problem before you asked the question.
Don't post homework questions
Programmers are good at spotting homework questions; most of us have done them ourselves. Those questions are for you to work out, so that you will learn from the experience. It is OK to ask for hints, but not for entire solutions.