Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

i still working this please check it.

Pay Check

Use this form to calculate the Regular Pay, Overtime Pay, Gross Pay, and Net Pay for an employee.

/ Script 4.9 - paycheck.js // This script concatenates two strings together to format a name.

// Function called when the form is submitted. // Function formats the text and returns false. function calculate() { 'use strict';

// For storing the employee name: var regularpay, overtimepay, grosspay, totaltaxes, netpay, employeename, ; // Get a reference to the form values: var firstName = document.getElementById('firstName').value; var lastName = document.getElementById('lastName').value; var regularhoursworked = document.getElementById('regularhoursworked').value; var overtimehoursworked = document.getElementById('overtimehoursworked').value; var hourlyrate = document.getElementById('hourlyrate').value; var ficatax = document.getElementById('ficatax').value; var statetax = document.getElementById('statetax').value; var tax = document.getElementById('tax').value;

// Create the employee name: employeename = firstName + ', ' + lastName;

regularpay = regularpay.toFixed(2); overtimepay = overtimepay.toFixed(2); grosspay = grosspay.toFixed(2); netpay = netpay.toFixed(2);

// Display the employee name:

document.getElementById('result').value = employeename; document.getElementById('regularpay').value = regularpay; document.getElementById('overtimepay').value = overtimepay; document.getElementById('grosspay').value = grosspay; document.getElementById('totaltaxes').value = totaltaxes; document.getElementById('netpay').value = netpay; // Return false to prevent submission: return false;} // End of employeename() function. // Function called when the window has been loaded. // Function needs to add an event listener to the form. function init() { 'use strict'; document.getElementById('theForm').onsubmit = calculate; } // End of init() function. window.onload = init;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

List the basic documents used in estate planning.

Answered: 1 week ago

Question

Identify and describe a suggested outline of a business plan.

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago