References:
A hypothetical province uses the following rule to calculate your provincial income tax:
For example, if a person's taxable income is $90,000, then the provincial tax he/she needs to pay is calculated as:
first $42,184 * 5.06% = $2,134.5104 next $42,185 * 7.70% = $3,248.2450 remaining $5,631 * 10.50% = $591.2550 -------------------------------------- total $80,000 to pay tax: $5,974.01
Your Tasks:
Download the Lab 8's input file.
In the input file, the tax rate parameters are stored in the yellow area. And starting from row 20, there are a list of customer's information, including customer's taxable income.
Develop a VBA program that calculates each customer's provincial tax based on the customer's taxable income and writes the result to the corresponding cells of column C.
Note: Your program must use a loop statement (instead of an extended if-else statement) to decide which range the user's taxable income falls into.
For the lab exercise, I provided the answer for each customer in column D. You can use the sample answer to check whether your program works correctly.
There is a weekly Assignment 8 following this lab.