web代写 | 代写homework | 代写oop | css | assignment | php – CS602 Module4 Assignment

CS602 Module4 Assignment

web代写 | 代写homework | 代写oop | css | assignment | php – 这是一个web面向对象设计的practice, 考察web的理解, 涵盖了web/oop/css/php等程序代做方面, 这个项目是assignment代写的代写题目

css代写 代写css 网页代做

 2021 , Suresh Kalathur, All Rights Reserved.
The following document should not be disseminated outside the purview of its intended purpose.

General Rules for homework Assignments

  • You are strongly encouraged to add comments throughout the program. Doing so will help your instructor to understand your programming logic and grade you more accurately.
  • You must work on your assignments individually. You are not allowed to copy the answers from the others.
  • Each assignment has a strict deadline. Assignments submitted after the deadline will carry a penalty.
  • When the term lastName is referenced in an assignment, please replace it with your last name.

Download and extract the starter template zip file, CS602_HW4_ lastName. Rename the folder with your last name. Complete the corresponding assignment files in this folder.

Part 1 Conditionals ( 40 Points)

Write a single php script, income_tax_v1.php, with the following functionality:

The script will first prompt the user to enter a gross annual income. Upon receiving any valid numeric (integer or float/double) value from the form, the script will then calculate the corresponding income tax based on the following tables:

The initial view of the web application is shown below.

After the user enters the income, say 150000, the view of the

application is as shown below. The input form along with the results

should be displayed.

The user can then try with a different income, say 1000000, as shown

below.

In the script, income_tax_v1.php, write four different functions, incomeTaxSingle , incomeTaxMarriedJointly , incomeTaxMarriedSeparately , and incomeTaxHeadOfHousehold. Each function takes the taxable income as its argument and returns the computed tax as per the corresponding tax table. In each function, use the if and elseif statements to implement the functionality. Hard-code the table values in the conditional statements and the income tax calculations, i.e., dont define constants to use in the functions. The form data is submitted using the POST method.

You can customize the css as you desire. The sample output shown uses Bootstrap.

Part 2 Arrays and Loops (60 Points)

Write a single PHP script, income_tax_v2.php, with the following functionality:

Define the TAX_RATES using PHP7 array syntax as shown below.

Using the above data, write a single function, incomeTax , that takes two arguments, the taxable income and the filing status. In this function, access the three pieces of data for the given filing status and store them in local variables. Using a loop and with the help of the if and break statements, determine the index for the income range. Using this index, calculate the income tax as per the table and return this value. This function should not hard code any of the tax table information.

For example, for a taxable income of 50000, the above index value would be 2 for Single, 1 for Married_Jointly, 2 for Married_Separately, and 1 for Head_Household.

The script should also display the tax tables using the above TAX_RATES data. Use an outer foreach l oop to iterate over the status. Output the first row, then use a for loop to output the rest of the rows except the last row, and then output the last row. The first and last row have a different pattern than the rest.

The initial view of the form is shown below.

After the user enters the income, say 150000, the view of the application is as shown below. The input form along with the results and the tax tables should be displayed.

Submission: Export your CS602_HW 4 _ lastName folder

containing all the relevant files as a zip file, and upload the zip

file to the Assignment section.