SHARE
TWEET

Untitled

advictoriam Jan 15th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class ComputePay
  2. {
  3.    /**
  4.       Compute pay (including overtime) for worker. Hours in excess of 40 hours
  5.       are paid at time-and-a-half.
  6.       @param wage the hourly wage for the employee
  7.       @param hoursWorked the number of hours worked by employee in one week
  8.       @return the amount of pay employee earned
  9.    */
  10.    public static double payForWeek(double wage, double hoursWorked)
  11.    {
  12.       if(hoursWorked > 40)
  13.       {
  14.          return wage*40 + (wage*1.5*(hoursWorked - 40));
  15.       }
  16.       return wage*hoursWorked;
  17.    }
  18. }
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