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

profilerehab

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;
}

 

    • 12 years ago
    • 5
    Answer(2)

    Purchase the answer to view it

    blurred-text
    NOT RATED

    Purchase the answer to view it

    blurred-text
    NOT RATED