1. Define a function pay(hourlyWage, nHours) that calculates and returns an employee's pay in dollars for working
nHours at an hourly rate of hourlyWage. Any hours beyond 40 is overtime and should be paid at 1.5 times the
regular hourly wage.
Once you've written it, test it to make sure that it works as expected. To test your function, call it with parameter
values for which you know what answer to expect. For example, if hourlyWage=12 and nHours=20, what pay
do you expect? What about houlyWage = 100 and nHours = 50? Write these tests in the same file money.py
with your function definition.
Note: Peter doesn't get paid overtime when the boss asks him to come into work on Saturday.
2. In the same file add one more function: monthlyPayment(P, r, n), which returns the monthly payment on an
initial loan of amount P at annual interest rate r (as a fraction of one, not a percent) for a duration of n years.
The formula for the monthly payment is given by: M = $\frac{P(1 + \frac{r}{12})^{12n}(\frac{r}{12})}{(1 + \frac{r}{12})^{12n} - 1}$
Verify that your formula is correct by calling your function and printing the result to calculate the monthly
payment on a $400000 loan at 4.5% interest rate for 30 years. The answer should be $2026.74. Do this in your
money.py module (i.e. script).