Please help me with this one, if you do you\'re agenius!!, anything Helps!! I ne
ID: 3611240 • Letter: P
Question
Please help me with this one, if you do you're agenius!!, anything Helps!!
I need it fast I've got an hour or so!! PLEASE!!:)
The cosine of an angle can be computed from thefollowing infinite series:
cosx=1-x^2/2!+x^4/4!-x^6/6!+x^8/8!-x^10/10!+.....
Write a program to compute the cosine of theangles from 0 to 360 degrees(increment of 10) by:
a. using C++ library function cos(x).
b. calling the module that calculate the fiveterms of this sreies.
c. using the terms from the series as long as theabsolute of a term is greather than 0.0001, aslo printthe
numbers of the terms used in the seriesapproximation.
Print results in screen and in a datafile
Ex: (this is how it would look like)
x(degree) cos(x) approx. cos(x)1 approx. cos(x)2number of termns
0 ? ? ? ?
. . . . .
360 ? ? ? ?
***The angle x should be converted into radiansfor the calculations,
Ex. x(in radians)=x(in degree*Pi/180
n!=n*(n-1)*(n-2)*....
Explanation / Answer
please rate - thanks better late then never! #include #include #include int fact(int); void coss(double,double&,double&, long int &); int main() {double x,pi=3.14159,cosm,cos5; long int i,ct; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.