Answer:
PLeas check the Explanation below for the python code
should you need further information let me know ASAP
Explanation:
Create a Python program that will calculate the user’s net pay based on the tax bracket he/she is in.
Let the user's pay be y
say the user earns x amount
Let us say the tax brackets are 0-25, 26-50, 51-100 in percentage
0-25= 10% tax
26-50= 20% tax
51-100= 30% tax
The expression for the cost is
y= x+(x*t/100)
x= int(input("enter your pay here: "))
t= int(input("enter your tax rate here: "))
#calculates the pay after 10% deduction
if t in range(0,26):
y=x-(x*10/100) #this is the cost function
print("your net pay after tax deduction is ", y)
#calculates the pay after 10% deduction
elif t in range(26,51):
y=x-(x*20/100) #this is the cost function
print("your net pay after tax deduction is ", y)
#calculates the pay after 10% deduction
elif t in range(51,101):
y=x-(x*30/100) #this is the cost function
print("your net pay after tax deduction is ", y)
else:
print("you have entered incorrect values")