Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need python code for the below functions. Sample output is also given exemption(income, filing status, family members) It returns the part of the income that

Need python code for the below functions. Sample output is also given

image text in transcribed

image text in transcribed

exemption(income, filing status, family members) It returns the part of the income that is "exempted" from taxation. Obviously, it can't be higher than the income. Parameters: income (float) is the amount of income in dollars. filing_status (integer) is the status of the filing person: 1-single, 2-married filing jointly, 3-married filing separately. family_members (integer) is the total number of family members (if parents are filing separately both of them are still counted in family_members) Return value: The amount (float) of the income that is exempted Logic: The base exemption is $3000 for the filing person and $2000 for each child. If a couple is filing jointly, both spouses are eligible for the exemption. If the income is above $100,000 the parent's exemption is reduced by 0.5% per whole thousand dollars of income above 100K Regardless of the income, though, this reduction cannot exceed 30%. If the family has more than two children, the child exemption is reduced by 5% for each additional child (ie. for 3 kids-5%, for 4 kids-10%, and so forth). Regardless of the number of children, though, the child's exemption cannot be reduced more than 50%. Examples: exemption(11500.67, 1,1) exemption(17230.18, 1,3) 3000.00 7000.00 max_bracket(income, filing status) Description: It returns the maximum tax bracket that a combination of income and filing status will reach based on the above table: Parameters: income (float) and filing.status (integer) are the same as above Return value: The bracket number (integer) of the max bracket max_bracket(100, 3) max_bracket(47890.99,3)-3 au d rom aperani aecheks tax_withheld(income) Parameters: income (float) is the same as above Return value: The amount (float) of tax Logic: Tax withholding is done at a fixed rate of 15% of the net income. Net income is the remaining amount after social security and medicare taxes are subtracted from income. Social security rate is 12.4%. Medicare is 2.9% but only applies to the first $100K portion of the income. Both social security and medicare taxes are split equally between employer and employee. tax_withheld (10000.00) tax.withheld(123456.78) 1385.25 17152.87 exemption(income, filing status, family members) It returns the part of the income that is "exempted" from taxation. Obviously, it can't be higher than the income. Parameters: income (float) is the amount of income in dollars. filing_status (integer) is the status of the filing person: 1-single, 2-married filing jointly, 3-married filing separately. family_members (integer) is the total number of family members (if parents are filing separately both of them are still counted in family_members) Return value: The amount (float) of the income that is exempted Logic: The base exemption is $3000 for the filing person and $2000 for each child. If a couple is filing jointly, both spouses are eligible for the exemption. If the income is above $100,000 the parent's exemption is reduced by 0.5% per whole thousand dollars of income above 100K Regardless of the income, though, this reduction cannot exceed 30%. If the family has more than two children, the child exemption is reduced by 5% for each additional child (ie. for 3 kids-5%, for 4 kids-10%, and so forth). Regardless of the number of children, though, the child's exemption cannot be reduced more than 50%. Examples: exemption(11500.67, 1,1) exemption(17230.18, 1,3) 3000.00 7000.00 max_bracket(income, filing status) Description: It returns the maximum tax bracket that a combination of income and filing status will reach based on the above table: Parameters: income (float) and filing.status (integer) are the same as above Return value: The bracket number (integer) of the max bracket max_bracket(100, 3) max_bracket(47890.99,3)-3 au d rom aperani aecheks tax_withheld(income) Parameters: income (float) is the same as above Return value: The amount (float) of tax Logic: Tax withholding is done at a fixed rate of 15% of the net income. Net income is the remaining amount after social security and medicare taxes are subtracted from income. Social security rate is 12.4%. Medicare is 2.9% but only applies to the first $100K portion of the income. Both social security and medicare taxes are split equally between employer and employee. tax_withheld (10000.00) tax.withheld(123456.78) 1385.25 17152.87

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

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions