Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

program in c. Please write comments so I could UNDERSTAND the code. Thank you. 5. Write a function that determines the tax amount according to

program in c. Please write comments so I could UNDERSTAND the code. Thank you.

5. Write a function that determines the tax amount according to the following tax rules. The tax rate depends on the income, the marital status, and the state residency. For in state residents, the following rates apply. If single and income is less than 30000 then tax rate is 20%. If single and income is greater or equal to 30000 then tax rate is 25%. If married and income is less than 50000 then tax rate is 10%. If married and income is greater or equal to 50000 then tax rate is 15%. For out of state residents, the similar rules apply except the tax rate is 3% less than the tax rate of the corresponding in state residents. The function prototype is double compute_tax(int income, char *status, char state). The income is positive integer. The status is string single or married in lower or upper case letters. The state is character i or o in lower or upper case letters. The function computes and returns the tax amount. If any input is invalid then the function returns -1.

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_2

Step: 3

blur-text-image_3

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 In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

=+country competitive advantages? Why? Support your point of view.

Answered: 1 week ago

Question

=+from: a) a MNEs perspective? and b) the HRM managers perspective?

Answered: 1 week ago