repl.it
Python

No description

fork
loading
Files
  • main.py
  • corey_schafer
  • adress_books.py
main.py
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
class Employee:
    no_emps = 0
    raise_amount = 1.04
    def __init__(self,first,last,pay):
        self.first = first
        self.last = last
        self.pay = pay
        self.email = first + '.' +last+ '@company.com'
        Employee.no_emps +=1
    def fullname(self):
        return self.first + ' ' + self.last
    def apply_raise(self):
        self.pay = int(self.pay * self.raise_amount )
print(Employee.no_emps)    
emp_1 = Employee('John','Son',5222220000)
emp_2 = Employee('Jane','Son',8222220000)
print(Employee.no_emps)
print (emp_1.fullname())
print (emp_1.email)
print (emp_1.pay)
print (emp_2.pay)
emp_1.apply_raise()
emp_2.apply_raise()
print (emp_1.pay)
print (emp_2.pay)