//Maxwell Brewer CS1A Chapter 3, P. 147, #20
//
/***************************************************************
*
* CALCULATE OUTPUT ANGLES
* _____________________________________________________________
*
* This program will prompt the user for an angle in radians,
* and then display the sine, cosine, and tangent of the angle.
* _____________________________________________
* INPUT
*
* radians
*
* OUTPUT
*
* sine, cosine, tangent
*
***************************************************************/
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;
int main() {
// Initialization
const char entAngle[] = "Enter angle: \n";
const char valSin[] = "The sine value is: ";
const char valCos[] = "The cosine value is: ";
const char valTan[] = "The tangent value is: ";
double radian, sine, cosine, tangent;
// Display input prompts
cout << entAngle;
cin >> radian;
sine = sin(radian);
cosine = cos(radian);
tangent = tan(radian);
// Output
cout << valSin << fixed << setprecision(4) << sine << endl;
cout << valCos << fixed << setprecision(4) << cosine << endl;
cout << valTan << fixed << setprecision(4) << tangent << endl;
return 0;
}
Ly9NYXh3ZWxsIEJyZXdlciAgICAgICAgICAgIENTMUEgICAgICAgICAgIENoYXB0ZXIgMywgUC4gMTQ3LCAjMjAKLy8KLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogKiAKICogQ0FMQ1VMQVRFIE9VVFBVVCBBTkdMRVMKICogX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwogKiAKICogVGhpcyBwcm9ncmFtIHdpbGwgcHJvbXB0IHRoZSB1c2VyIGZvciBhbiBhbmdsZSBpbiByYWRpYW5zLAogKiBhbmQgdGhlbiBkaXNwbGF5IHRoZSBzaW5lLCBjb3NpbmUsIGFuZCB0YW5nZW50IG9mIHRoZSBhbmdsZS4KICogX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCiAqIElOUFVUCiAqIAogKiByYWRpYW5zCiAqIAogKiBPVVRQVVQKICogCiAqIHNpbmUsIGNvc2luZSwgdGFuZ2VudAogKiAKICoqKioqKio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