Generation

generate functionFri, 27 Jan 2023

Create a program that takes as input an employee's salary and a rating of the employee's performance and computes the raise. A number indicating the performance rating (1=excellent, 2=good, and 3=poor). An employee with a rating of 1 will receive a 6% raise, an employee with a rating of 2 will receive a 4% raise, and one with a rating of 3 will receive a 1.5% raise.

Script def raise_pay(salary, rating): if rating == 1: return salary * 1.06 elif rating == 2: return salary * 1.04 else: return salary * 1.015 raise_pay(50000, 3)

Questions about programming?Chat with your personal AI assistant