Write a program that asks the user for an angle, entered in radians.

Category: Computer Science

Write a program  that asks the user for an angle, entered in radians. The program  should then display the sine, cosine, and tangent of the angle. (Use the sin, cos, and tan library functions to determine these values .) All numeric values  in the output  should be displayed in fixed-point notation, rounded to four decimal places of precision.

Here is one sample run:

Enter angle: 1.07078
sin(1.07078)=0.8776
cos(1.07078)=0.4794
tan(1.07078)=1.8304

 

I got this so far

 

#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;
int main ()

{
double radians;

cout << “Enter angle:”;
cin >> radians;

cout << ” sin(3.1415)=” <<
fixed << setprecision(4) << sin(radians) << endl;
cout << “cos(3.1415)=”
<< fixed << setprecision(4) << cos(radians) << endl;
cout << “tan(3.1415)=” <<
fixed << setprecision(4) << tan(radians) << endl;

cin.ignore();
cin.get();
return 0;
}

 

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Pay Someone To Write Essay