Question: This project will introduce functions. ( Mandatory ) A Taylor series expansion can approximate various functions with its terms...the more terms, the closer to the

This project will introduce functions.
(Mandatory) A Taylor series 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
sin(x)=n=0(-1)n(2n+1)!x2n+1, for all x
cos(x)=n=0(-1)n(2n)!x2n, 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 cases: 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.)
(Optional)Add a tan(x) function to the first program. You will use the sin(x) and cos(x)
functions to implement the tan(x) function ).
Test cases: tan(0.5)=0.5463;tan(2)=-2.18504
(Please use basic c++ code)
hard-coded loops?...not
allowed (use the method that
the assignment shows, and as
demonstrated in class)
remember that you must use
separate files when you make
your own functions....a so, no
header file? (as repeatedly
discussed in class!
This project will introduce functions. (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!