Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The Paycheck assignment requires that we create an application that calculates p

ID: 3849936 • Letter: T

Question

The Paycheck assignment requires that we create an application that calculates paycheck information.
The user inputs First Name, Last Name, Regular Hours worked, Overtime Hours worked, Hourly PayRate,
FICA, State, and Federal Tax Rates. The application calculates and displays the Regular Pay, Overtime
Pay, Gross Pay, Total Taxes, and Net Pay.

1. Create an HTML5 file that contains a HTML form like the screenshots shown above that accepts
the First Name, Last Name, Regular Hours Worked, Overtime Hours Worked, Hourly Rate, Fica
Tax Rate, State Tax Rate, and Federal Tax Rate for entry and shows the Regular Pay, Overtime
Pay, Gross Pay, Total Taxes, Employee Name, and Net Pay and a submit button with the label
Calculate. Save the file as paycheck.html and store it in your Ch04 directory. The paycheck.html
file must be free of errors and validated. Add the necessary code to link to a CSS file called
styles.css that is stored in your Ch04/css subdirectory. Add the necessary code to use the
paycheck.js file that is stored in your Ch04/js subdirectory.
2. Download the styles.css file and store it in your Ch04/css subdirectory.
3. Create and debug a JavaScript file that processes the Paycheck information from the
paycheck.html file that meets the following specifications

a. Save the file as paycheck.js in your Ch04/js subdirectory.
b. Create a function that is called when the paycheck.html form is submitted. The function
must include the following information.

c. Output variables for the Regular Pay, Over Time Pay, Gross Pay, Total Taxes, Net Pay,
and Employee Name return results to the paycheck.html file.

d. Input variables for the First Name, Last Name, Regular Hours, Overtime Hours, Hourly
Rate, Fica Tax, State Tax, and Federal Tax use the document.getElementByID method to
retrieve input from the paycheck.html file).
e. Regular Pay will be correctly calculated and formatted with the toFixed() method.
f. Overtime Pay will be correctly calculated and formatted with the toFixed() method.
g. Gross Pay will be correctly calculated and formatted with the toFixed() method.
h. Fica Tax deducted will be correctly calculated.
i. State Tax deducted will be correctly calcorrectly
j. Federal Tax deducted will be correctly calculated.
k. Total Taxes will be correctly calculated and formatted.
l. The Employee Name will be correctly displayed.
m. The Net Pay will be correctly calculated and formatted with the toFixed() method.
n. The init() function will be correctly used.

Taxes, and Net Pay. The application also performs the following user entry validation tests: 1. Ensure that Hours Worked is entered and is between 0 and 80. 2. Ensure that Hourly Pay Rate is entered and is between 0 and 100.00. If both of the above conditions are not met, an error message alert window appears that says the following: Please enter valid hours and a valid payrate! Because the user isn't entering Regular Hours and Overtime Hours as with the first paycheck assignment, you must use an If statement to test Hours Worked to calculate Regular Hours and OverTime Hours and Regular Pay and overtime Pay. All Hours worked over 40 are considered overtime Hours while Hours Worked between 0 and 40 are considered Regular Hours. As with the previous assignment, Regular Pay is calculated as Regular Hours worked Hourly Pay Rate. Overtime Pay is calculate as overtime Hours Hourly Rate 1.5. All of the remaining Gross Pay, Total Taxes, and Net Pay variables are calculated as with the previous assignment. The following screenshots demonstrate how the application works

Explanation / Answer

The code is given below :

<html>
<head>
<script>
function calculate(){   
var a = frmMain.name.value;
var b = parseFloat(frmMain.Salary.value);
var c = parseFloat(frmMain.taxrate.value);
var area = document.getElementById("text");
area.innerHTML='Name : '+a+' Salary : '+b+' Tax Rate : '+c;
}
</script>
</head>
<body>
<form name="frmMain">
Name <input type ="text" id="name" /><br />
Salary <input type ="text" id="Salary" /><br />
tax rate <input type ="text" id="taxrate" /><br />
<input type="button" value="calculate" />
<input type="reset" value="Clear" /><br />
Sammary<textarea cols="20" rows="5" id="text"></textarea>
</form>
</body>
</html>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote