Question: I am having trouble creating a paycheck with HTML and PHP. In this assignment we are supposed to: 1. Create an HTML file that has

I am having trouble creating a paycheck with HTML and PHP. In this assignment we are supposed to:

1. Create an HTML file that has input variables for the First Name, Last Name, Hours Worked, and Hourly Rate. Save the file as phpPaycheck2.html. Within the HTML file, do not state that any of the input values are required and do not state the minimum and maximum values for Hours Worked or Hourly Rate. The phpPaycheck2.html file must use the POST method to send data to the phpPaycheck2.php file for processing.

2. Create a PHP file The PHP file processes First Name, Last Name, Hours Worked, and Hourly Rate using the POST method from the phpPaycheck2.html file. The application calculates and displays the Regular Pay, Overtime Pay, Gross Pay, FICA Tax Withheld, State Tax Withheld, Federal Tax Withheld, Total Taxes, and Net Pay. The FICA Tax Rate, State Tax Rate, Federal Tax Rate, and Employee Name are also displayed. Save the file as phpPaycheck2.php

4. The phpPaycheck2.php file must meet the following specifications (24 Points Total as broken down below):

a. Via the PHP comment tag, comments are used correctly and appropriately throughout the document.

b. Input variables for the First Name, Last Name, Hours Worked, and Hourly Rate are submitted from the phpPaycheck2.html file and processed by the phpPaycheck2.php file using the POST method.

c. Validate that First Name is entered. If not, display a message that says You forgot to enter your First Name. Please go back and fill out the form again.

d. Validate that Last Name is entered. If not, display a message that says You forgot to enter your Last Name. Please go back and fill out the form again.

e. Validate that Hours Worked is entered and is between 0 and 80. If not, display a message that says You must enter Hours Worked that is between 0 and 80.

f. Validate that Hourly Rate is entered and is between 0 and 100.00. If not, display a message that says You must enter an Hourly Rate that is between 7.25 and 100.00.

g. If one or more of the above conditions are not met, display a message that says Please go back and fill out the form.

h. FICA Tax Rate of 5.65% is defined as a constant.

i. State Tax Rate of 5.75% is defined as a constant.

j. Federal Tax Rate of 28.00% is defined as a constant. Remember that percentages are actually decimals.

k. Regular Pay will be correctly calculated as up to 40 Hours Worked * Hourly Rate and formatted with the number_format() function.

l. Overtime Pay will be correctly calculated as Hours Worked over 40 * Hourly Rate * 1.5 and formatted with the number_format() function.

m. Gross Pay will be correctly calculated as Regular Pay + Overtime Pay and formatted with the number_format() function.

n. FICA Tax Rate will be correctly displayed.

o. FICA Tax Withheld will be correctly calculated as Gross Pay * FICA Tax Rate and formatted with the number_format() function.

p. State Tax Rate will be correctly displayed.

q. State Tax Withheld will be correctly calculated as Gross Pay * State Tax Rate and formatted with the number_format() function as shown.

r. Federal Tax Rate will be correctly displayed.

s. Federal Tax Withheld will be correctly calculated as Gross Pay * Federal Tax Rate and formatted with the number_format() function as shown.

t. Total Taxes will be correctly calculated as FICA Tax Withheld + State Tax Withheld + Federal Tax Withheld and formatted with the number_format() function.

u. The Employee Name will be correctly displayed by concatenating the First Name and Last Name.

v. The Net Pay will be correctly calculated as Gross Pay Total Taxes and formatted with the number_format()

What I have so far is:

paycheck

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

PLEASE HELP

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!