i can't do these last two questions for college and i would really appreciate some help:
9. SlowDrivers Inc. pay their workers a basic wage of £4.60 an hour. If an employee works over 40
hours a week they receive £5.60 an hour for every hour of overtime they work. Workers can work a
maximum of 80 hours a week.**
Create a function called calculateWage. The function should prompt the user to enter the number
of hours they have worked and assign this to a variable called hours. Create two variables
basicWage and overTime which will store the rates of pay. Complete the rest of the code for this
function which will calculate the user’s wage based on the number of hours that they have worked
in that week.**
If a user has entered a correct number of hours, then the alert box should say “Your basic wage is
£” followed by the correct output. If the user enters an incorrect number of hours, then the alert
box should say “Please check the number of hours that you have worked.” [14]
Hint: use the built in method of .toFixed(2) to ensure the final wage is displayed to two
decimal places.
* *
10. HighPrice Gas Ltd. charge their customers for gas as follows
No of Units used Price(£)
0 to 100 £1 per unit
101 to 1000 £1 per unit, plus 50p for each additional unit over 500
Over 1000 £3 per unit, plus 5p for each additional unit over 1000
Create a function called gasReading which takes a parameter called units. When run, the function
should pass in the number of units used by a customer and calculate the price, which is stored in a
variable called cost. The function should then return the cost as part of an alert box, with the text
“Your gas bill is: ” and then display the cost of the gas used. Call this function, passing the value
1200 as a parameter. [12]
Thank you