// this is switch practice
#include <iostream>
usingnamespace std;
#define PI 3.14159
#include <string>
int main ()
{
int x;
unsignedlong a,b,c,d,e,f;
string degree, radian, meter;
cout<<"What you wanna do?\n1) Convert from degree to radian\n2) Convert from radian to degree\n3) Convert from inch to meter\n4) Quit"<<endl;
cin>>x;
switch (x)
{
case 1:
cout<<"Please enter the degree: ";
cin>>a;
radian=a*PI/180;
cout<<"The result is: "<<radian;
break;
case 2:
cout<<"Please enter the radian: ";
cin>>b;
degree=b*180/PI;
cout<<"The result is: "<<degree;
break;
case 3:
cout<<"Please enter the inch(es): ";
cin>>c;
meter=c*0.0254;
cout<<"The result is: "<<meter;
break;
default:
cout<<"Press enter to quit";
break;
}
return 0;
}