Answered step by step
Verified Expert Solution
Link Copied!

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:
\table[[Salary Range (USD),Base Tax (USD),Percentage of Excess (%)],[0-9,999.99,0,10],[10,000-19,999.99,1,000,12],[20,000-29,999.99,2,200,15],[30,000-39,999.99,3,300,18],[40,000-49,999.99,4,400,20]]
\table[[Salary Range (USD),Base Tax (USD),Percentage of Excess (%)],[50,000 and above,5,500,25]]
Example:
For a salary of $23,000, the program would identify the range $20,000-$29,999.99. The base tax for this range is $2,200, and the percentage of excess is 15%. The salary exceeds the lower end of the range by $3,000($23,000-$20,000). Therefore, the excess tax would be 15% of $3,000, which is $450. The total tax would be the sum of the base tax and the excess tax, amounting to $2,200+$450=$2,650.
Enter your salary: 23000 Total tax to pay: $2650.00
Another example:
Enter your salary: 36900
Total tax to pav: $4542.00
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions