Here is the scenario of my calculation. I need to compute an employee withholding tax based on his filing status-either single or married and his weekly taxable wages.
I have a tblSingleTax table which compose of the following fields and record values .
This tax table need to store in a table to become updatable anytime when there is new tax rate.
fldNotOver fldBase fldPercentage fldExcessOver
51 0 0 0
517 0 15% 51
1,105 69.90 28% 517
2,493 234.54 31% 1,105
5385 664.82 36% 2,493
0 1,705.94 39.6% 5,385
Now assume that an employee has a taxable wages for a week of $600 and he is a single.
We scan the column fldNotOver , stopping the search when we encounter the first value that is greater than or equal to the taxable wages.
The computation of his withholding tax as follows:
Taxable wages $600.00
Less:Excess Over (517.00)
------------
Subtotal1 83.00
Multiply: Percentage * .28
------------
Subtotal2 23.24
Add: Base + 69.90
----------
Withholding Tax 93.14
How can I store the tax table into an multidimensional array? If you have a better solution other than using an array, much better. Please tell me how to do it with a code example.
Thanks.