title: problems with switch statement involving functions
body: <p>This program is not prompting me for input. I need help with defining, and calling functions properly. menu() is supposed to display a string of text, and ask the user to select a number 1-4, and if the user enters a number outside of that it will ask the user to enter an appropriate number until 1-4 is entered. The value of menu() will be stored in a variable 'choice' and be used in a switch statement. 
  Inside of the switch statement the corresponding choice functions[getSum(), getFactor(), getExpo(), and exit()] are called. They each need to ask the user for an integer, and perform some arithmetic, and return some output text to the user with the calculated value. 
  All of this is inside of a do while loop repeating this process, until the user chooses the option 4 to quit the program, where the exit() function will return a string exit message to the user and then the program will terminate.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;cmath&gt;
  using namespace std;
  
  int menu();
  long int getSum();
  long int getFactor();
  long int getExpo();
  string exit();
  
  
  int main()
  {
          const int SUM = 1, // Summation choice
      FACTOR = 2, // Factorial choice
      EXPO = 3, // Exponential choice
      QUIT = 4; // Exit choice
  
  
      int choice; // Numerical menu choice
      long int sums, facts, expos;
      string quits;
  
  
      // Force the console to print standard notation
      cout &lt;&lt; fixed &lt;&lt; setprecision(0);
  
      // Do-While loop controlled by the users choices
      do
      {
          choice = menu();
  
  
  
          switch (choice) // Start switch option
          {
              case SUM: // 1st choice
              sums = getSum();
              break;
  
          case FACTOR: // 2nd choice
              facts = getFactor();
              break;
  
          case EXPO: // 3rd choice
              expos = getExpo();
              break;
  
          case QUIT: // 4th choice
              quits = exit();
              break;
  
          default: // Default choice
              // Error message for input outside domain
              cout &lt;&lt; "Please make a selection of either 1,2,3 or 4.\n\n";
              cin &gt;&gt; choice; // Repeat attempt to gather input from user
          }
      }
      while (menu() != QUIT);
  
      return 0;
  }
  
  int menu()
  {
      int choice;
      cout &lt;&lt; "\n\t\tMathematical Menu\n" // Header
      &lt;&lt; "1) Summation\n" // 1st choice
      &lt;&lt; "2) Factorial\n" // 2nd choice
      &lt;&lt; "3) Exponential\n" // 3rd choice
      &lt;&lt; "4) Exit Program\n\n" // 4th choice
      &lt;&lt; "Please make a selection\n" // Ask user for imput choice
      &lt;&lt; "of either 1,2,3 or 4.\n\n";
      cin &gt;&gt; choice; // Gather input from user
      return choice;
  }
  
  long int getSum()
  {
      int total = 0, userNum, counter;
  
      // Ouput statement to user
      cout &lt;&lt; "Please enter a positive integer value greater than 0 \n"
      &lt;&lt; "and less than 10,000,000.\n\n";
      cin &gt;&gt; userNum; // Repeat attempt to gather input from user
  
      // Compare input to domain
      if (userNum &lt; 0 || userNum &gt; 10000000)
      {
          // Error message for input outside domain
          cout &lt;&lt; "Please check your entry and try again.\n\n";
      cin &gt;&gt; userNum; // Repeat attempt to gather input from user
  }
  
  // Perform arithmetic summation
  for (counter = 1; counter &lt;= userNum; counter++)
  {
      total += counter; // Running count
  }
  cout &lt;&lt; "The total value for the added numbers 1 to \n"
  &lt;&lt; userNum &lt;&lt; " is:\n"&lt;&lt;total;
  return total;
  }
  
  long int getFactor()
  {
  int total, userNum, counter;
  
  total = 1;
  // Output statement to user
  cout &lt;&lt; "Please enter a positive integer from 0 \n"
  &lt;&lt; "and less than 100.\n\n";
  cin &gt;&gt; userNum; // Gather input from user
  
  // Compare input to domain
  if (userNum &gt; 100 || userNum &lt; 0)
  {
      // Error message if input is outside domain
      cout &lt;&lt; "Please check your entry and try again.\n\n";
      cin &gt;&gt; userNum; // Repeat attempt to gather input from user
  }
  
  // Perform arithmetic factorial
  for (counter = 1; counter &lt;= userNum; counter++)
  {
      total *= counter; // Running count
  }
  
  // Display arithmetic output to user
  cout &lt;&lt; "The total value for the multiplied numbers 1 to \n"
  &lt;&lt; userNum &lt;&lt; " is:\n";
  return total;
  }
  
  long int getExpo()
  {
  int total, userNum, counter;
  
  total = 0;
  // Output statement to user
  cout &lt;&lt; "Please enter a positive integer from 0 \n"
  &lt;&lt; "and less than 100.\n\n";
  cin &gt;&gt; userNum; // Gather input from user
  
  // Compare input to domain
  if (userNum &gt; 100 || userNum &lt; 0)
  {
      // Error message if input is outside domain
      cout &lt;&lt; "Please check your entry and try again.\n\n";
      cin &gt;&gt; userNum; // Repeat attempt to gather input from user
  }
  
  // Perform arithmetic exponential
  for (counter = 1; counter &lt;= userNum; counter++)
  {
      total = pow(2.0, userNum); // Running count
  }
  
  // Display arithmetic output to user
  cout &lt;&lt; "The total value for the exponential function is \n";
  return total;
  }
  
  string exit()
  {
  // Exit message
  return "Don't be gone for too long...\n";
  
  }`
  </code></pre>