title: Salary calculator (over time pay) require assistance of senior level programmers
body: <p>4.16 (Salary Calculator) Develop a C++ program that uses a while statement to determine the
  gross pay for each of several employees.
  When someone works 41 hours or more. They get paid 1.5x more so my problem is that in my else if statement. I did rate * 1.5 which should translate into 10 * 1.5 = 15 but I get 425 because my code on the top probably, but I don't understand it at the moment.
  He gave us this example. Which I'm trying to emulate. </p>
  
  <p>"
  Enter hours worked (-1 to end): 41</p>
  
  <p>Enter hourly rate of the employee ($00.00): 10.00</p>
  
  <p>Salary is $415.00
  "</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  { 
  double salary=0,rate=0,hours=0,counter=0;
  cout &lt;&lt; "Enter your hours worked: ";
  cin &gt;&gt; hours;
  cout &lt;&lt; "Enter your rate: ";
  cin &gt;&gt; rate;
  
  while(counter&lt;=hours)
  {   salary=hours*rate;
      counter++;
  }
      if(hours==-1)
          {exit(0);
      }
      else if(hours&gt;=41)
      {
      rate = rate * 1.5;
      salary = salary + rate;
      }
  
  cout &lt;&lt; "$" &lt;&lt; salary;
  
  return 0;
  </code></pre>
  
  <p>}</p>