Advertisement
Guest User

Untitled

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