-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathemployee.py
38 lines (34 loc) · 915 Bytes
/
employee.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
26
27
28
29
30
31
32
33
34
35
36
37
38
##
# Defines an employee of a business.
#
class Employee :
##
# Constructs an employee object that contains their name and salary.
#
def __init__(self) :
self._name = ""
self._baseSalary = 0.0
##
# Sets the name of the employee.
# @param newName string containing the employee's name
#
def setName(self, newName) :
self._name = newName
##
# Sets the employee's base salary.
# @param newSalary the employee's base salary as a floating-point
#
def setBaseSalary(self, newSalary) :
self._baseSalary = newSalary
##
# Gets the employee's name.
# @return a string containing the name
#
def getName(self) :
return self._name
##
# Gets the employee's salary.
# @return the salary as a numerical value
#
def getSalary(self) :
return self._baseSalary