title: loss of precision-->Required double but compiler required int?
body: <p>I am a beginner in java and faced this error.</p>
  
  <p>Write a method named pay that accepts a real number for a TA's salary and an integer for the number of hours the TA worked this week, and returns how much money to pay the TA. For example, the call pay(5.50, 6) should return 33.0.</p>
  
  <p>The TA should receive "overtime" pay of 1 ½ normal salary for any hours above 8. For example, the call pay(4.00, 11) should return (4.00 * 8) + (6.00 * 3) or 50.0.</p>
  
  <pre><code>public double pay(double x,int y){
      int sum=0;
      double hours=8.0;
      if(y&gt;hours){
         sum=(y-hours)*(1.5*x) + (hours*x);
  
      }
     return sum;
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre>You have a mismatch between data types. This often occurs when you try to store a real number (double) into a variable or parameter that is an integer (int).
  possible loss of precision
  found   : double
  required: int
         sum=(y-hours)*(1.5*x) + (hours*x);
                               ^
  1 error
  19 warnings
  </pre>
  
  <p>But the error is pointing at the + sign.What is wrong with it?
  It says found:double. But I want my output to be double. But it said as required int.</p>