Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Javascript Create a web page that uses JavaScript to print a payroll report for a company that has a few employees, all earning the same

Javascript

Create a web page that uses JavaScript to print a payroll report for a company that has a few employees, all earning the same hourly wage: $15 per hour for up to 40 hours per week. If the employee worked more than 40 hours, the hours in excess of 40 are paid at one and a half times this rate.

The user enters the (integer) number of hours worked in the week for each employee in a pop-up box. Use an open-ended loop so that the number of employees can vary. Have the user enter a negative number such as -1 to indicate that there are no more employees to enter. (The program should do something reasonable if the user enters -1 as the first value.)

The program prints, as web page contents, a table containing three columns. The first column is simply an index that increases from 1 up to the number of employees processed. The second column is the number of hours worked, entered by the user. The third column is the employee's pay for the week. After the table, please print out a summary line giving the total pay of all the employees.

The output does not need to be fancy, but correct and readable. The table columns should have headings identifying them, and the total pay should a suitable label.

Place the JavaScript code into an external file, referenced by the src attribute of the