Computing the sine of angle using the built in trigonometric function and The Taylor series approximation

The assignment is about computing the sine of the angle using the built in trigonometric function and computing the sine using the Taylor series approximation.

• Prompt for input angle in units of radians.
• Read input angle in units of radians.
• Compute and output the sine of the input angle using built-in trigonometric functions.
• Compute and output the Taylor series approximation of sin(x) including terms up to order seven (i.e., 7 x ).

***It won't execute the expression that I put*** Please help


#include <iostream>
#include <cmath>

using namespace std;

int main()
{

double angle= 0.0;

double sin= 0.0;

double value;


cout << "Please Enter an Angle in Units of Radians...";
cin>> angle;

value = sin * (angle);


cout << "The sine of angle is ...";
cin >> value;


value = ((angle) - (pow (angle,3) / 6) + (pow (angle,5) / 120) - (pow (angle,7) / 5040));

cout << "The sine of the angle in Taylor Series approximation...";
cin>> value;





return 0;
}
That's pretty close, but a few errors too.

Mainly, you are asking the user for input (cin) when you should be displaying the result (cout).

Also, you don't need this variable: double sin= 0.0;, delete that line.

Then change this line:
 
value = sin * (angle);  // multiply variable sin by variable angle 

to this:
 
value = sin(angle); // call the sin() function 

thank you for you help
Topic archived. No new replies allowed.