Answer and Explanation:
Using Javascript:
Function TotalWeeklyPay(rate,hours,overtimeHours)
{
var total = rate*hours+overtimeHours*1.5*rate;
return total;
}
TotalWeeklyPay();
In order to take input of hourly wage, total regular hours, and total overtime hours, we make them our parameters in the function TotalWeeklyPay() and then use them to calculate total weekly pay in our function. We call the function TotalWeeklyPay() after definition.