Abstract Level 2 |Assignment Set-5|Object Oriented Programming Using Python|NM|Infosys Springboard

preview_player
Показать описание
#naanmudhalvan #infosys #springboard
#answers
#objectorientedprogrammingusingpython
#answersdotcom
#abstractlevel2
Assignment on Abstract - Level 2
Problem Statement
Softsytems Ltd is a private firm that provides software solutions to its customers.
The management wants to calculate salary for the employees. There are two types of employees namely graduates who are in probation period and laterals who are experienced joiners in the company.
Write a python program based on the class diagram given below.



Class Description:
Employee class:

validate_basic_salary(): Basic salary of an employee is always more than 3000

If basic salary is valid, return true. Else return false

validate_qualification(): Employee should posses either a "Bachelors" or "Masters" degree

If qualification is valid, return true. Else return false

Graduate class:

validate_job_band(): Graduates can be in "A", "B" or "C" job band

If job band is valid, return true. Else return false

calculate_gross_salary(): Calculate gross salary

Validate basic salary, qualification and job band

If valid,

Compute gross salary as basic salary + PF+ TPI amount + incentive PF is 12% of basic salary Identify TPI amount based on cgpa Identify incentive based on job band.Incentive should be applied on basic salary (Refer tables given)

Return gross salary

Else return -1

Job Band

A

B

C

D

E

F

Incentive %

4

6

10

13

16

20



CGPA

4 to 4.25

4.26 to 4.5

4.51 to 4.75

4.76 to 5

TPI Amount

1000

1700

3200

5000

Lateral class:

validate_job_band(): Laterals can be in "D", "E" or "F" job band

If job band is valid, return true. Else return false

calculate_gross_salary(): Calculate gross salary

Validate basic salary, qualification and job band

If valid,

Compute gross salary as basic salary + PF + SME bonus + incentive PF is 12% of basic salary Identify SME bonus based on skill set Identify incentive based on job band.Incentive should be applied on basic salary (Refer tables given)

Return gross salary

Else return -1

Skill Set

SME Bonus

AGP

6500

AGPT

8200

AGDEV

11500

Perform case sensitive string comparison.
For testing:

Create objects of Graduate and Lateral classes

Invoke calculate_gross_salary() on Graduate and Lateral objects

Display the details
Рекомендации по теме
Комментарии
Автор

from abc import ABCMeta, abstractmethod

emp_qualification=["Bachelors", "Masters"]
graduate_job_band=["A", "B", "C"]
lateral_job=["D", "E", "F"]
bonus={"AGP":6500, "AGPT":8200, "AGDEV":11500}
emp_incentive={"A":4, "B":6, "C":10, "D":13, "E":16, "F":20}

class Employee(metaclass=ABCMeta):
def __init__(self, job_band, employee_name, basic_salary, qualification):
self.__job_band=job_band




def get_employee_name(self):
return self.__employee_name

def get_job_band(self):
return self.__job_band

def get_basic_salary(self):
return self.__basic_salary

def get_qualification(self):
return self.__qualification

@abstractmethod
def validate_job_band(self):
pass

@abstractmethod
def
pass

def validate_basic_salary(self):
if self.__basic_salary>3000:
return True
else:
return False

def
if self.__qualification in emp_qualification:
return True
else:
return False


class Graduate(Employee):
def __init__(self, job_band, employee_name, basic_salary, qualification, cgpa):
super().__init__(job_band, employee_name, basic_salary, qualification)
self.__cgpa=cgpa

def get_cgpa(self):
return self.__cgpa

def validate_job_band(self):

if band in graduate_job_band:
return True
else:
return False

def
if self.validate_basic_salary() == True and self.validate_qualification() == True and self.validate_job_band() == True:
incentive=0
tpi=0


incent=emp_incentive[band]
incentive=incent/100

if 4<= self.__cgpa <= 4.25:
tpi=1000
elif 4.26 <= self.__cgpa <= 4.5:
tpi=1700
elif 4.51 <= self.__cgpa <= 4.75:
tpi=3200
elif 4.76 <= self.__cgpa <= 5:
tpi=5000

gross_salary = salary + salary * incentive + tpi + salary * 0.12
return gross_salary
else:
return -1


class Lateral(Employee):
def __init__(self, job_band, employee_name, basic_salary, qualification, skill_set):
super().__init__(job_band, employee_name, basic_salary, qualification)
self.__skill_set=skill_set

def get_skill_set(self):
return self.__skill_set

def validate_job_band(self):

if band in lateral_job:
return True
else:
return False

def
if self.validate_basic_salary() == True and self.validate_qualification() == True and self.validate_job_band() == True:
sme=0
incentive=0


incent=emp_incentive[band]
incentive=incent/100
sme = bonus[self.__skill_set]

gross_salary = salary + salary * incentive + sme + salary * 0.12
return gross_salary
else:
return -1


l=Lateral("D", "Sarah", 6500, "Masters", "AGP")
g=Graduate("B", "Sarah", 6500, "Masters", 4.65)
print(l.get_skill_set())
print(l.validate_job_band())


answersdotcom-bglx