-
Notifications
You must be signed in to change notification settings - Fork 0
/
mayer379_7A.py
32 lines (31 loc) · 1.08 KB
/
mayer379_7A.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
# CSci 1133 HW 7
# Nicholas Mayer
# HW Problem A
#
# This script will create a MnEmployee class object
class MnEmployee:
def __init__(self,ID=0,salary=0,otWages=0,addWages=0,totalWages=0):
self.employeeID = ID
self.__salary = float(salary)
self.__otWages = float(otWages)
self.__addWages = float(addWages)
self.__totalWages = float(totalWages)
def __lt__(self, other):
if self.__totalWages < other.__totalWages:
return True
else:
return False
def __gt__(self, other):
if self.__totalWages > other.__totalWages:
return True
else:
return False
def __repr__(self):
return (str(self.employeeID)+','+str(self.__salary)+','
+str(self.__otWages)+','+str(self.__addWages)+','
+str(self.__totalWages)+'\n')
def __str__(self):
return ('%12s\t%12s\t%12s\t%12s\t%12s' %
(str(self.employeeID),str(self.__salary),
str(self.__otWages),str(self.__addWages),
str(self.__totalWages)))