An organization has decided to provide salary hike to its employees based on their job level. Employees can be in job levels 3 , 4 or 5. Hike percentage based on job levels are given below: Job level Hike Percentage (applicable on current salary) 3 15 4 7 5 5 In case of invalid job level, consider hike percentage to be 0. Given the current salary and job level, write a python program to find and display the new salary of an employee. Identify the test data and use it to test the program.
Answers
Answered by
8
Answer:
what do you want in answer
Answered by
5
Below are the code for the above question in python language:
Explanation:
Salary= float(input("Enter the value of a salary")) # Take input of the salary.
Level = int(input("Enter the job level")) # Take input for the level of the job.
if(Level==3): # it is used for the level 3.
print("The new salary will be: "+str(Salary+(Salary*0.15)))
elif(Level==4): # It is used for the level 4.
print("The new salary will be: "+str(Salary+(Salary*0.07)))
elif(Level==5): # It is used for the level 5.
print("The new salary will be: "+str(Salary+(Salary*0.05)))
else: # It is used for the invalid input.
print("The new salary will be: "+str(Salary))
Output:
- If the user gives input 90 for the salary and 3 for the level then the output will be 103.5
- If the user gives input 90 for the salary and 7 for the level then the output will be 90.
Code Explanation:
- The above code works for the question problem because it is defined with the help of the if-elif-statement.
- When the if-statement becomes false the elif-statement executes and when it becomes false the else statement or the other elif-statement executes.
Learn more:
- Python program : https://brainly.in/question/5985607
Similar questions
Physics,
5 months ago
Physics,
5 months ago
English,
10 months ago
English,
10 months ago
Social Sciences,
1 year ago