-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhomework6_repeattask.py
More file actions
50 lines (30 loc) · 847 Bytes
/
homework6_repeattask.py
File metadata and controls
50 lines (30 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class Company:
def __init__(self, emp):
self.rate = 0.1
def compute_hike(self,sal):
self.salary = sal
self.hiked_perc = self.rate*self.salary
self.hiked_salary = self.salary + self.hiked_perc
def employee_name(self,name):
self.emp_name= name
def employee_status(self):
self.emp_status = 'Active'
def employee_id(self,emplo_id):
self.emp_id = emplo_id
def change_status(self, c_state):
if c_state == 'active':
self.changed_state = 'terminated/suspended'
else:
self.changed_state = 'active'
emp1 = Company()
emp2 = Company()
emp3 = Company()
emp1.compute_hike(200)
emp1.change_status('terminated/suspended')
emp1.employee_status()
emp1.employee_id(1)
print(emp1.hiked_salary)
print(emp1.changed_state)
print(emp1.emp_status)
print(emp1.emp_id)
print("<<<<<<<<<<<<<<<<<og ans>>>>>>>>>>>>>>>>>>>>>>")