Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started