1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
//Math functions (censored)
int main()
{
char A='A', S='S', M='M', D='D', s='s', E='E';
string options;
float a, b, c, d, e, f, g, h, i, r;
do
{
printf ("What would you like to do?\n \n A - Addition\n S - Subtraction\n M - Multiplication\n D - Division\n s - Square Root\n E - Exit\n \n");
cin >> options;
if (options == "A")
{
//Addition
}
else if (options == "S")
{
//Subtraction
}
else if (options == "M")
{
//Multiplication
}
else if (options == "D")
{
//Division
}
else if (options == "s")
{
//Square Root
}
else if (options == "E")
{
return 0;
}
else
{
printf ("\n");
printf ("Incorrect symbol\n");
}
printf ("\n");
} while (options == 'A'|'S'|'M'|'D'|'E'|'s');
}
| |