Question: urpose: This lab introduces programming using functions and organizing them using .h and .cpp files. roblems: n this lab you are first redoing Lab 4

urpose: This lab introduces programming using functions and organizing them using .h and .cpp files. roblems: n this lab you are first redoing Lab 4 using functions to implement your solution and then developing ome new functions. (15 pts.) Start using the project TrigFunctions. 1. Create a MyMath.h and MyMath.cpp to provide implementations of trigonometric functions. 2. Before your functions in MyMath.cpp, put in the line const int p=8;// defines the number of terms in the series expansion 3. You are to implement the function Cos(x) to compute the cosine of x using the summation: Cos(x)=i=0p(1)i(2i)!x2i=12!x2+4!x46!x6 The code for this was developed in class. Create the function definition in MyMath.cpp and place the function prototype in MyMath.h. 4. You are to implement the function Sin(x) to compute the cosine of x using the summation: Sin(x)=i=0p(1)i(2i+1)!x2i+1=x3!x3+5!x57!x7 You need to develop the code to implement this series expansion. Create the function definition in MyMath.cpp and place the function prototype in MyMath.h. 5. Run the code (TrigFunctions). It will generate the values of sin(x),Sin(x),cos(x), and Cos(x) for all x from 0 to 2 advancing by 0.1. You should look at how accurate your functions are by looking at the results in output.csv, in particular look at the end of the file (the results get worse as x grows)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
