fork download
#include 
#include 

double AproxPI();
double Angle2Radian(float);
double XcordIfRotated(double);


int main(){

	double aproxpi = AproxPI();

	std::cout.precision(5);

	std::cout<<	"Ccompute the cosine of:";

	std::cout<<"\n\n\n\nA) 0 Degrees = "<< Angle2Radian(0) << " Radians";
	std::cout<<"\nB) 90 Degrees = "<< Angle2Radian(90) << " Radians";
	std::cout<<"\nC) 30 Degrees = "<< Angle2Radian(30) << " Radians";
	std::cout<<"\nD) 70 Degrees = "<< Angle2Radian(70) << " Radians";

	std::cout<<	"Therefor the cosine of:";

	std::cout<<"\n\n\n\nA) Cosine of 0 Degrees = "<< cos(Angle2Radian(0) );
	std::cout<<"\nA) Cosine of 90 Degrees = "<< cos(Angle2Radian(90) );
	std::cout<<"\nA) Cosine of 30 Degrees = "<< cos(Angle2Radian(30) );
	std::cout<<"\nA) Cosine of 70 Degrees = "<< cos(Angle2Radian(70) );


	std::cout<<"\n\n\nPress Enter to Continue.";
	std::cin.ignore();
}

double AproxPI(){

	double tmp = 1;
	return 4*atan(tmp);
}

double Angle2Radian(float angle){

	return (angle * AproxPI() ) / 180;
}
Success #stdin #stdout 0.01s 2728KB
stdin
Standard input is empty
stdout
Ccompute the cosine of:



A) 0 Degrees = 0 Radians
B) 90 Degrees = 1.5708 Radians
C) 30 Degrees = 0.5236 Radians
D) 70 Degrees = 1.2217 RadiansTherefor the cosine of:



A) Cosine of 0 Degrees = 1
A) Cosine of 90 Degrees = 6.1232e-17
A) Cosine of 30 Degrees = 0.86603
A) Cosine of 70 Degrees = 0.34202


Press Enter to Continue.