# Arup Guha
# 10/13/2020
# Solution to COP 2930 Program 6, Part B: Testing Overtime Pay function

# Pre-conditions: payPerHour is a positive floating pt 
#  number representing the pay per hour. regWorkWeek
#  represents the number of hours in a regular work week
#  (int). hoursWorked is the number of hours the employee
#  worked (int). overtimeRate is the multiplicative rate
#  for overtime pay.
# Post-condition: Returns the overtime pay for the employee.
def overtimePay(payPerHour, regWorkWeek, hoursWorked, overtimeRate):
    
    # Can't get over time if you didn't work extra hours.
    if hoursWorked <= regWorkWeek:
        return 0

    # Here we take extra hours and multiply by the improved pay rate.
    return (hoursWorked-regWorkWeek)*payPerHour*overtimeRate

# Test cases I provided.
def testOvertimePay():
    print(overtimePay(8.25, 40, 30, 1.5))
    print(overtimePay(12.50, 30, 40, 2.0))
    print(overtimePay(9.99, 80, 100, 2.5))

testOvertimePay()
