Skip to main content

Infosys's InfyTQ Assignment 17

Question:

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.


Estimated Time:30 minutes


Solution:

def find_new_salary(current_salary,job_level):     # write your logic here     if job_level == 3:         new_salary = current_salary + (current_salary*0.15)     elif job_level == 4:         new_salary = current_salary + (current_salary*0.07)     elif job_level == 4:         new_salary = current_salary + (current_salary*0.05)     else:         return current_salary
    return new_salary
# provide different values for current_salary and job_level and test yor program new_salary=find_new_salary(15000,3) print(new_salary)

Comments

Popular posts from this blog

Infosys's InfyTQ Assigment 15

Assignment 15: Collaborative Assignment - Level 1 Question: Write a python program to find and display the product of three positive integer values based on the rule mentioned below: It should display the product of the three values except when one of the integer value is 7. In that case, 7 should not be included in the product and the values to its left also should not be included. If there is only one value to be considered, display that value itself. If no values can be included in the product, display -1. Note : Assume that if 7 is one of the positive integer values, then it will occur only once. Refer the sample I/O given below. Sample Input Expected Output 1, 5, 3 15 3, 7, 8 8 7, 4, 3 12 1, 5, 7 -1 Estimated Time: 20 minutes Solution: def   find_product ( num1 , num2 , num3 ):     product= 0      #write your logic here      if  num3 ==  7 : ...