Question
python code. No importing modules You may assume that: The types of the values that are sent to the functions are the proper ones, you
python code. No importing modules
You may assume that:
-
The types of the values that are sent to the functions are the proper ones, you dont have
to validate them
-
The functions are going to be called with usable values. Income and tax rate wont have
negative values, etc.
-
Minimum amount is 1 cent. Fractions of it should be rounded to closest cent.
-
A married person cannot le as single
-
A single parent will le as single
-
A couple has the option to le either jointly or separately
-
When a couple is ling separately both of them are still counted as family_members
exemption(income, ling_status, family_members)
Description: It returns the part of the income that is "exempted" from taxation. Obviously, it cant be higher than the income.
Parameters: income ( oat) is the amount of income in dollars. ling_status (integer) is the status of the ling person: 1=single, 2=married ling jointly, 3=married ling separately. family_members (integer) is the total number of family members (if parents are ling separately both of them are still counted in family_members)
Return value: The amount ( oat) of the income that is exempted.
Logic: The base exemption is $3000 for the ling person and $2000 for each child. If a couple is ling jointly, both spouses are eligible for the exemption. If the income is above $100,000 the parents 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 (i.e. for 3 kids -5%, for 4 kids -10%, and so forth). Regardless of the number of children, though, the childs exemption cannot be reduced more than 50%.
Examples:
exemption(11500.67, 1, 1) 3000.00 exemption(17230.18, 1, 3) 7000.00
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