Final answer:
To determine the raise and new salary for an employee based on their performance rating, you can use if...else statements. Here is an example of a program that calculates the raise and new salary.
Step-by-step explanation:
To determine the raise and new salary for an employee based on their performance rating, you can use if...else statements. Here is an example of a program that calculates the raise and new salary:
current_salary = float(input('Enter the current annual salary: '))
performance_rating = int(input('Enter the performance rating (1=excellent, 2=good, 3=poor): '))
if performance_rating == 1:
raise_percentage = 6
elif performance_rating == 2:
raise_percentage = 4
else:
raise_percentage = 1.5
raise_amount = current_salary * (raise_percentage / 100)
new_salary = current_salary + raise_amount
print('The raise amount: $', raise_amount)
print('The new salary: $', new_salary)
In this program, the user is prompted to enter the current annual salary and performance rating. The if...else statements determine the raise percentage based on the rating. Finally, the raise amount and new salary are calculated and displayed.