#include <iostream>
#include <cmath>
#include <string>
usingnamespace std;
int main()
{
char function;
double val;
cout << "This calculator requires you to enter a funtion and a number" << endl;
cout << "The functions are as follows: " << endl;
cout << "S - sine " << endl;
cout << "C - cosine " << endl;
cout << "T - tangent " << endl;
cout << "R - square root " << endl;
cout << "N - natural log " << endl;
cout << "X - exit the program " << endl;
cout << endl;
cout << "Please enter a function and a value: " << endl;
cin >> function >> val;
while (toupper(function) != 'X')
{
switch (function)
{
case'S':
cout << "The sine of your number is " << sin(val) << endl;
break;
case'C':
cout << "The cosine of your number is " << cos(val) << endl;
break;
case'T':
cout << "The tangent of your number is " << tan(val) << endl;
break;
case'R':
cout << "The square root of your number is " << sqrt(val) << endl;
break;
case'N':
cout << "The natural log of your number is " << log(val) << endl;
break;
case'X':
break;
}
cout << "Please enter a function and a value: " << endl;
cin >> function >> val;
}
cout << "Thanks for using the calculator" << endl;
return 0;
}