How do you make a fully functional calculator?
I understand you can make a calculator multiple ways. Most of the instances I see are similar to below... #include <iostream> using namespace std; int main() { float a; float b; cout<<"first number: "; cin>>a; cout<<a<<endl; cout<<"second number: "; cin>>b; cout<<b<<endl<<endl; float sum=a+b; float multiply=a*b; float divide=a/b; float minus=a-b; cout<<"+: "<<sum<<endl; cout<<"x: "<<multiply<<endl; cout<<"/: "<<divide<<endl; cout<<"-: "<<minus<<endl; return 0; } However I would like there to be a prompt like so... "Enter a number" "Enter an operator (+, -, *, /)" "Enter another number" "Answer" I cannot find a way to make the operator an input on its own. Like how you would use a normal calculator. I'm very new to C++. Any help would be greatly appreciated.