I have an assignment that states that you have to write a function that calculates...
1 – 2(x^2)/1! + 3(x^4)/2! – 4(x^6)/3! + … + [(-1)^n](n+1)(x^2n)/n!
The general term is:
negative one to the power of n
multiply by (n plus one)
multiply by x to the power of (2n)
divided by n factorial
And it must be written as a program that calls ONE single function, and all the calculations must take place in that one single function.
Basically all the main program does is output the result, after the function calculates it.
I'm finding it hard to understand how to write one single function that calculates all of those different equations... I only know about pow(), nFact(), and ourFabs() right now...driving me insane because the teacher doesn't teach anything and hardly speaks english.