title: Creating a calculator c++
body: <p>My current code is:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cmath&gt;
  #include&lt;cstdlib&gt;
  
  using namespace std;
  
  int main()
  {
      char cAgain, type;
      int x, y=0;
      double addition(double num1, double num2), subtraction(double num1, double num2), division(double num1, double num2), 
          multiplication(double num1, double num2), exponential(double num1, double num2), num1, num2, total;
      do
      {
          cout &lt;&lt; "How many operations would you like to do?" &lt;&lt; endl;
          cin &gt;&gt; x;
          if (x &lt;= 0)
          {
              cout &lt;&lt; "Error: You must have 1 or more operations." &lt;&lt; endl;
          }
          else
          {
              while (x != 0, x--)
              {
                  y++;
                  cout &lt;&lt; "Enter in your "&lt;&lt;y&lt;&lt; " operation. (First Number (+,-,*,/,^) Second Number)" &lt;&lt; endl;
                  cin &gt;&gt; num1 &gt;&gt; type &gt;&gt; num2;
                  switch (type)
                  {
                  case '+':
                      total = addition(num1, num2);
                      cout &lt;&lt; num1 &lt;&lt; " + " &lt;&lt; num2 &lt;&lt; "= " &lt;&lt; total&lt;&lt; endl;
                      break;
                  case'-':
                      total = subtraction(num1, num2);
                      cout &lt;&lt; num1 &lt;&lt; " - " &lt;&lt; num2 &lt;&lt; "= " &lt;&lt; total&lt;&lt; endl;
                      break;
                  case'/':
                      total = division(num1, num2);
                      cout &lt;&lt; num1 &lt;&lt; " / " &lt;&lt; num2 &lt;&lt; "= " &lt;&lt; total&lt;&lt; endl;
                      break;
                  case'*':
                      total = multiplication(num1, num2);
                      cout &lt;&lt; num1 &lt;&lt; " * " &lt;&lt; num2 &lt;&lt; "= " &lt;&lt; total &lt;&lt; endl;
                      break;
                  case'^':
                      total = exponential(num1, num2);
                      cout &lt;&lt; num1 &lt;&lt; " ^ " &lt;&lt; num2 &lt;&lt; "= " &lt;&lt; total &lt;&lt; endl;
                      break;
                  }
              }
          }
          cout &lt;&lt; "Would you like to run the program again.(Y/N)" &lt;&lt; endl;
              cin &gt;&gt; cAgain;
      } while (cAgain == 'Y' || cAgain == 'y');
  return 0;
  }
  
  double addition(double num1, double num2)
  {
      double total;
      total = num1 + num2;
      return (total);
  }
  double subtraction(double num1, double num2)
  {
      double total;
      total = num1 - num2;
      return (total);
  }
  double division(double num1, double num2)
  {
      double total;
      total = num1 / num2;
      return (total);
  }
  double multiplication(double num1, double num2)
  {
      double total;
      total = num1 * num2;
      return (total);
  }
  double exponential(double num1, double num2)
  {
      double total;
      total = pow(num1,num2);
      return (total);
  }
  </code></pre>
  
  <p>Currently the code works as it is suppose too.<br>
  It starts by asking<br>
  How many operations would you like to do?<br>
  You enter a number say 3<br>
  Then it ask you to enter in your operation<br>
  5+5<br>
  10<br>
  Then it ask for second<br>
  10^2<br>
  100<br>
  Then it ask for third<br>
  100-10<br>
  90<br>
  Then it ask if you want to start over and run the program again.</p>
  
  <p>What I am trying to change it too is  to  5+5^2-10= and it give me 20.<br>
  Essentially I want the user to be able to enter in the entire operation like 5+5^2-10= and it give me the correct answer. Allowing the user to type in a function and use '=' and return to start the calculation.</p>