Answer to Question #329085 in Python for ratul

Question #329085

Write a function called calculate_tax that takes 3 arguments: your age, salary, and current job

designation.

Your first task is to take these arguments as user input and pass these values to the function.

Your second task is to implement the function and calculate the tax as the following conditions:

NO TAX IF YOU ARE LESS THAN 18 YEARS OLD.

NO TAX IF YOU ARE THE PRESIDENT OF THE COMPANY

No tax if you get paid less than 10,000

5% tax if you get paid between 10K and 20K

10% tax if you get paid more than 20K


1
Expert's answer
2022-04-17T02:50:24-0400
def calculate_tax(age, salary, current_job):
    if age < 18:
        tax = 0
    elif current_job == "presedent of the company":
        tax = 0
    elif salary < 10000:
        tax = 0
    elif salary < 20000:
        tax = 0.05 * salary
    else:
        tax = 0.1 * salary

    return tax


age = int(input("ENter your age: "))
salary = int(input("Enter your salary: "))
current_job = input("Enter your current job: ")

tax = calculate_tax(age, salary, current_job)
print("Your tax is", tax)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS