First C++ calculator This is my first C++ program. It would be nice if you can tell me anything I could add or do differently.
I am new to C++ programming and I hope to learn more.
#include &lt;iostream&gt;
using namespace std;

int main()
{
    float a, b, result;
    char op;

    cout &lt;&lt; &quot;Enter an operator.&quot; &lt;&lt; endl;

    cin &gt;&gt; op;

    cout &lt;&lt; &quot;Enter first value.&quot; &lt;&lt; endl;

    cin &gt;&gt; a;

    cout &lt;&lt; &quot;Enter second value.&quot; &lt;&lt; endl;

    cin &gt;&gt; b;

    cout &lt;&lt; &quot;----------------------&quot; &lt;&lt; endl;

    switch (op)
    {
    case '+':
        result = a + b;
        cout &lt;&lt; result;
        break;

    case '-':
        result = a - b;
        cout &lt;&lt; result;
        break;

    case '*':
        result = a * b;
        cout &lt;&lt; result;
        break;

    case '/':
        result = a / b;
        cout &lt;&lt; result;
        break;

    default:
        cout &lt;&lt; &quot;Invalid operation. Program terminated.&quot; &lt;&lt; endl;
        return -1;
    }
}
there is a lot of thing you can do to further add depth:

move the printing out of the switch
display an help with current operators
implements others operator (pow(), sin(), square(), root()...), you'll then have to check the number of arguments
use a std::map&lt;string, *functionPointer&gt; to avoid the switch
implement a parsing function so you can just enter something like &quot;3+2*8&quot;, this would require care as you have to check operator precedence, using prefix or postfix representation could help and allow ignoring &quot;)(&quot;.