Skip to content

Instantly share code, notes, and snippets.

@Keith-S-Thompson
Created July 17, 2012 02:22
Show Gist options
  • Save Keith-S-Thompson/3126587 to your computer and use it in GitHub Desktop.
Save Keith-S-Thompson/3126587 to your computer and use it in GitHub Desktop.
//
// 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