Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. package pkg;
  2. import java.util.*;
  3. public class Salary {
  4.     /* Hamsheed */
  5.     public static void main(String[] args) {
  6.        
  7.         double hourlyRate, regularHours, overtime;
  8.        
  9.         Scanner input = new Scanner(System.in);
  10.        
  11.         System.out.print("Enter Hourly Rate: ");
  12.         hourlyRate = input.nextDouble();
  13.         System.out.print("Enter Regular Hours: ");
  14.         regularHours = input.nextDouble();
  15.         System.out.print("Enter Overtime Hours: ");
  16.         overtime = input.nextDouble();
  17.        
  18.         double overtimepay = calcOvertimePay(hourlyRate, regularHours, overtime);
  19.        
  20.         System.out.println("The overtime pay is " + overtimepay);
  21.     }
  22.    
  23.     public static double calcOvertimePay(double h, double r, double o){
  24.          return ((r * h) + o )* (1.5 * h);
  25.            
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement