This project was an assignment for BU MET CS602: Server-Side Web Development. Copying any portion and submitting it as your own work is a violation of Boston University's Academic Conduct Code and is prohibited.
- PHP
- Bootstrap
that's it... I never said it was pretty :)
The purpose of this project was to get comfortable with PHP and observe how using a 2D array of data can make the project code more elegant. In both versions, the user submits their annual income in a form and then views their yearly tax burden by filing status.
Download MAMP and place the code cloned from this repo in the "htdocs" folder within the MAMP program files. Open the MAMP application, click "start" in the upper-right corner, then click "webstart". In the browser window that opens, select "My Website" and choose the directory name for this project.
In Version1, the tax bracket data is not stored in a 2D array and thus the tax bracket boundaries are hard-coded into each function for Single, Married Filing Separately, Married Filing Jointly, or Head of Household status. As you can see, this creates a lot of cumbersome if-else statements and leads to lots of repeated code.
In Version2, the design is improved to store the data about minimum and maximum incomes for each tax bracket in a matrix. Rather than having a separate function for each filing status, the matrix allows us to loop over the matrix and locate the tax due with one function. Additionally, this version displays a table with all the tax tables.