Question: Develop a program that computes tax based on a user's salary using the provided decision table. When a user inputs their salary, the program should
Develop a program that computes tax based on a user's salary using the provided decision table. When a user inputs their salary, the program should determine the corresponding salary range in the decision table. The decision table outlines various salary brackets, each associated with a specific base tax amount and an excess percentage rate. To calculate the total tax, the program should add the base tax to the product of the excess percentage and the amount by which the salary exceeds the lower threshold of the identified range. Make sure you have comments to explain your code.
Decision Table:
tableSalary Range USDBase Tax USDPercentage of Excess
tableSalary Range USDBase Tax USDPercentage of Excess and above,
Example:
For a salary of $ the program would identify the range $$ The base tax for this range is $ and the percentage of excess is The salary exceeds the lower end of the range by $$$ Therefore, the excess tax would be of $ which is $ The total tax would be the sum of the base tax and the excess tax, amounting to $$$
Enter your salary: Total tax to pay: $
Another example:
Enter your salary:
Total tax to pav: $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
