Question: Your project folder needs to contain 2 files: a HTML file and a PHP file. You'll have a HTML page with a form that submits

Your project folder needs to contain 2 files: a HTML file and a PHP file.

You'll have a HTML page with a form that submits a name and an annual income to a web server. The HTML form will need 2 named textboxes and a submit button. The first allows the user to enter their full name, the second allows the user to enter their taxable income for the year. The income should be a number, so don't enter dollar signs and commas to express the income as currency--just enter the raw number. The HTML form should submit the two textbox values to a php page that will calculate the income tax due on the income.

The second page will be a php page that takes the name and income, and using the table given below, calculates the total tax due for that income. The user's name, income, and tax due should be returned to the user by your php page.

The page returned to the user should have a statement that look like the following, although the wording need not be exact:

John Smith, for a taxable income of $70000.00 the tax owed is $16011.25

Shown below is the 2001 Federal Income tax table for single taxpayers. This program requires using If-blocks, so you may have to access recent lecture notes and text assignments before getting a good idea of how to complete the program.

Your project folder needs to contain 2 files: a HTML file and

Keep in mind that a number in PHP does not have any non-numeric characters in it. So, your user must enter a straight number, one without dollar signs and commas. And your if-block should not test for numeric values that have dollar signs in them either.

For an example calculation, if a single person's income is 70000, then the tax calculation for tax owed, if everything were numeric literals, would be as follows. You can use this a a check for your calculation of this income bracket.

14654.00 + (.305 * (70000 - 65550)) = 16011.25

To get full credit:

Your program should calculate the correct tax for any valid income range.

If the user enters a non-number or a negative number, don't calculate anything, but rather, send the user a message saying that they have entered bogus data. The best way to test for this is either with the isset(), empty(), or is_numeric() built-in functions. Google these functions for examples.

Your php page should return the user's name, income, and tax owed.

See if you can get the numbers returned to the user with a dollar sign and rounded to 2 decimal places. Don't worry about putting commas in the numbers..

Taxable Income from Up to but not including Tax is $27,050 15% of the income $27,050 $65,550 $4,057.50 + (27.5% of the amount > $27,050) $65,550 $136,750 $14,654.00 + (30.5% of the amount > $65,550) $136,750 $297,350 $36,361.00 + (35.5% of the amount > $136,750) $297,350 and up $93,374.00 + (39.1% of the amount > $297,350)

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!