179k views
2 votes
Write an IF…ELSE program that computes the new salary for Ann, the Chief Information Officer of ABC Company. Ann’s current salary is $92,000 a year, and she has worked at ABC for four years. Please note the following: one-year employees get a 2 percent raise two-year employees get a 3 percent raise three-year employees get a 4 percent raise four-year employees get a 5 percent raise five-year employees get a 6 percent raise What is Ann’s new salary?

I’ll make you the brainless if you can help me plz

User Face
by
4.9k points

1 Answer

6 votes

In python 3.8:

salary = 92000

years = 4

if years == 1:

salary += (salary*0.02)

elif years == 2:

salary += (salary * 0.03)

elif years == 3:

salary += (salary *0.04)

elif years == 4:

salary += (salary*0.05)

elif years >= 5:

salary += (salary*0.06)

print(salary)

If we run this code, Ann's new salary will be 96600.

User Rajkumar Kumawat
by
4.8k points