title: Big O of Switch statement having function calls in its Cases?
body: <p>How can we calculate Big O of switch statement whom are having function calls in there  cases. that Function can be the Function in whom the switch statement is present and can also direst to another function whom can send it back to the same Switch statement.</p>
  
  <pre><code>void ifpascorrectSwitch(int *currentbalance) {
  
  cout &lt;&lt; "\n\n";
  cout &lt;&lt; "Current balance = £" &lt;&lt; *currentbalance &lt;&lt; endl;
  string casee;
  cout &lt;&lt; "Enter any of the below option\n"
          "1 for Deposit cash \n"
          "2 for Withdraw cash\n"
          "e for Quiting the application\n"
          "= ";
  
  
  cin &gt;&gt; casee;
  if (casee.length() == 1) {
      const char *k = casee.c_str(); // character inter to a c string
  
      switch (*k) {
  
          case '1':
              cout &lt;&lt; "1 Deopist cash \n";
              Depositcash(currentbalance);          
  </code></pre>
  
  <p>//Deposit is another function call whom can can come back to this function 
  // and have this switch menu again because of bellow given //ifpascorrectSwitch(currentbalance) which is function call of the current //function</p>
  
  <pre><code>            ifpascorrectSwitch(currentbalance);
  
              break;
          case '2':
              cout &lt;&lt; "2 Withdraw menu\n";
              WithdrawCash(currentbalance);
              ifpascorrectSwitch(currentbalance);
  
              break;
          case 'e':
              cout &lt;&lt; "r is working";
              break;
          default:
              cout &lt;&lt; "Default switch wrong entery";
              ifpascorrectSwitch(currentbalance);
              break;
      }
  
  } else {
      cout &lt;&lt; "Wrong entery please try again";
      ifpascorrectSwitch(currentbalance);
  }   }
  </code></pre>
  
  <p>All other function call other then ifpascorrectSwitch(currentbalance)which is current function call are having same scenario of switch stament. almost.</p>
  
  <p>If only someone could help me atleast undesrtanding this Switch statement Big O calcultaion.</p>