Advertisement
advictoriam

Untitled

Jan 15th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement