Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

******python***** Using the while loop Write a program to input the salary. If t

ID: 3878242 • Letter: #

Question

******python*****

Using the while loop Write a program to input the salary. If the salary is over 100,000 then calculate the federal tax at 20% otherwise calculate the federal tax 15%. Display the federal tax. Calculated the state tax at the rate of 5%Also, Count the number of people who earned salaries in the following ranges.1) More than 1000002) More 50000 and less than 1000003) More than 25000 and less than 500004) Below 25000 Ask the user if he/she wants to continue. If the user says “yes”, repeat the whole thing to fetch the salary of the next employee, calculate and display the federal tax, etc. The program should also calculate the total federal tax and total state tax with held from all the employees. You can do this using accumulation concept.Hint: Each time the computer calculates the federal tax for one employee, keep accumulating it.

Explanation / Answer

tf=0#to count total federal tax
ts=0#to count total state tax
a=0# to count the number of salaries >100000
b=0# to count the number of salaries between 50000-100000
c=0#to count the number of salaries between 25000-50000
d=0# to count the number of salaries less than 25000
while(True):
n = int(input("Enter salary:"))
if(n>=100000):
f=n*20/100#federal tax
a+=1
else:
f=n*15/100#federal tax
s = n*5/100#federal tax
if(n<100000 and n>=50000):
b+=1
elif(n<50000 and n>=25000):
c+=1
else:
d+=1
tf=tf+f
ts=ts+s
s = input("if you want to continue Enter yes else no:")
if(s=="yes"):
continue
else:
break

print("the number Enpolyees of salaries >100000: ",a)
print("the number of salaries between 50000-100000: ",b)
print("the number of salaries between 25000-50000: ",c)
print("the number of salaries less than 25000: ",d)
print("Total federal tax: ",tf)
print("Total state tax: ",ts)