Question: code Text Copy to Dive E 1 2 . In the United States of Pretendistan, income is taxed as follows: ifyour income it at most

code
Text
Copy to Dive
E12. In the United States of Pretendistan, income is taxed as follows:
ifyour income it at most $20,000 per year, you pay 5% of your total income as tax
otherwise, you pay 8% of your total income as tax
Complete the function compute_tas that uses an if-statement to compute and return the total tax due for the salary stored in the argument named salasy. Test your code on incomes of $10,000(return value should be $500) and $100,000(return value should be $8,000).
1 defcompute tax(salary):
2 # write your code here
[]1 # Call your function with an argument of 10000.
I]1 # Call your function with an argument of 100000.
13. What happens if you provide a negative value for salary? Make a copy of your compute tax function below and modify it so that the function to retum -10 if calay is negative. (Hint use the frelifeelse structure.)
[]1
E14. Now call your revised function with the same test cases as before (10000 and 100000
 code Text Copy to Dive E12. In the United States of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!