Question: The file Payroll calculations, htm contains JavaScript code that calculations an employee's pay. (That is, it would do so if had the appropriate HTML tags,

 The file "Payroll calculations, htm" contains JavaScript code that calculations an

The file "Payroll calculations, htm" contains JavaScript code that calculations an employee's pay. (That is, it would do so if had the appropriate HTML tags, variable declarations, and prompts.) Use this code to create a JavaScript function named "calculate Pay". Put the function in the header section of a file "Exercise 7.html," with appropriate tags. The function will need three parameters: the employee's name, hourly rate, and number of hours worked. Other variables (such as Base, Bonus and Total) will need to be declared in the function (NOT in the main script). This main script will prompt for the employee's name, hourly rate, and number of hours worked, and then will call the function to do rest of the work. THE MAIN SCRIPT MUST NOT USE ANY OF THE VARIABLES OR PARAMETERES NAMES USED IN THE FUNCTION. Thus, the main script will follow this outline (using appropriate variable names): Declare the variables used in the main script. Input the employee name, number of hours worked, and hourly pay rate. Call the function calculate pay, passing to it the employee name, number of hours worked, and the hourly pay rate (in the appropriate order). Base= Hours*Rate; if (Hours strict inequality 40){//No overtime bonus(0, 0) Bonus=0,0;} else {//Calculate overtime bonus Bonus=0.5*Rate*(Hours-40);}//end it Total= Base +Bonus; document. write ("Pay"+ the name+"5"+Total+" The file "Payroll calculations, htm" contains JavaScript code that calculations an employee's pay. (That is, it would do so if had the appropriate HTML tags, variable declarations, and prompts.) Use this code to create a JavaScript function named "calculate Pay". Put the function in the header section of a file "Exercise 7.html," with appropriate tags. The function will need three parameters: the employee's name, hourly rate, and number of hours worked. Other variables (such as Base, Bonus and Total) will need to be declared in the function (NOT in the main script). This main script will prompt for the employee's name, hourly rate, and number of hours worked, and then will call the function to do rest of the work. THE MAIN SCRIPT MUST NOT USE ANY OF THE VARIABLES OR PARAMETERES NAMES USED IN THE FUNCTION. Thus, the main script will follow this outline (using appropriate variable names): Declare the variables used in the main script. Input the employee name, number of hours worked, and hourly pay rate. Call the function calculate pay, passing to it the employee name, number of hours worked, and the hourly pay rate (in the appropriate order). Base= Hours*Rate; if (Hours strict inequality 40){//No overtime bonus(0, 0) Bonus=0,0;} else {//Calculate overtime bonus Bonus=0.5*Rate*(Hours-40);}//end it Total= Base +Bonus; document. write ("Pay"+ the name+"5"+Total+

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!