title: If/else if always goes to else statement
body: <p>I'm trying to make a function that determines commission based on user entered amount. It takes a user entered double and uses it to determine which equation it is used in. But the code I wrote always goes to the else statement, and I am not sure what is wrong with my conditions. </p>
  
  <pre><code>double calculate(double s)
  {
      double c;
      if (s &gt; 300,000)
      {
          c = 25,000 + (0.15 * (s-300,000));
          cout &lt;&lt; "went to if" &lt;&lt; endl;
          return c;
  
      }
  
      else if (300,000 &gt; s &amp;&amp; s &gt; 100,000)
      {
          c = 5,000 + (0.10 * (s-100,000));
          cout &lt;&lt; "went to else if" &lt;&lt; endl;
          return c;
  
      }
  
      else
      {
          c = 0.05 * s;
          cout &lt;&lt; "went to else" &lt;&lt; endl;
          return c;
  
      }
  } 
  </code></pre>