daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Feb 24th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package computepay;
  6.  
  7. /**
  8.  *
  9.  * @author Stropheum
  10.  */
  11. public class ComputePay
  12. {
  13.    /**
  14.       Compute pay (including overtime) for worker. Hours in excess of 40 hours
  15.       are paid at time-and-a-half.
  16.       @param wage the hourly wage for the employee
  17.       @param hoursWorked the number of hours worked by employee in one week
  18.       @return the amount of pay employee earned
  19.    */
  20.    public static double payForWeek(double wage, double hoursWorked)
  21.    {      
  22.        double totalPay = 0.0;
  23.        if (hoursWorked <= 40);
  24.                {
  25.                    totalPay = hoursWorked*wage;
  26.                }
  27.                else
  28.                   {
  29.                       totalPay = (40*wage+(wage*(hoursWorked-40));
  30.                   }
  31.        return totalPay;
  32.    }
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top