Question: In C++ only please. This project will introduce functions. A Taylor scribe's expansion can approximate various functions with its terms...the more terms, the closer to
In C++ only please. This project will introduce functions. A Taylor scribe's expansion can approximate various functions with its terms...the more terms, the closer to the real function value it is. The Taylor series expansion of (x) = sigma^infinity_n = 0 (-1)^n/(2n + 1)! x^2n + 1, for all x, and the Taylor series of cos(x) = sigma^infinity_n = 0 (-1)^n/(2n)! x^2n, for all x. Write two functions (using a new * .h and * .cpp file) that calculate sin(x) and cos(x), until some term is less than 10^-3. Write a program that prompts for x and uses your two functions to calculate these values. Print out the result. Test eases: sin (0.5) = 0.479425, cos (0.5) = 0.87758; sin(2) = 0.90929, cos(2) = -0.41614 Important! Use the factorial function given in class (from lecture) to do the denominators of the above equations.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
