Created
July 17, 2012 02:22
-
-
Save Keith-S-Thompson/3126587 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Code fragment based on http://stackoverflow.com/q/11515064/827263 | |
// | |
int main() | |
{ | |
cout << "Do you want to add, subtract, multiply or divide? I want to : " << endl; | |
cin >> ans; | |
if (ans == "add") { | |
OperateClass opOper; | |
opOper.add(); | |
} | |
else if (ans == "subtract") { | |
OperateClass opOper | |
opOper.subtract(); | |
} | |
else if (ans == "multiply") { | |
OperateClass opOper | |
opOper.multiply(); | |
} | |
else if (ans == "divide") { | |
OperateClass opOper | |
opOper.divide(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment