Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
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

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions

Question

What do you think has caused the failures?

Answered: 1 week ago

Question

=+ (c) From (18.10) deduce T(4) = VIT.

Answered: 1 week ago

Question

What is quality of work life ?

Answered: 1 week ago

Question

What is meant by Career Planning and development ?

Answered: 1 week ago

Question

What are Fringe Benefits ? List out some.

Answered: 1 week ago

Question

D How will your group react to this revelation?

Answered: 1 week ago