-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcfunctions.py
More file actions
37 lines (30 loc) · 1.04 KB
/
Copy pathcfunctions.py
File metadata and controls
37 lines (30 loc) · 1.04 KB
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
class cfunctions (): # to create class
# indent all the functions
def __init__(self, name ):
print( 'init of parent', __name__)
self.name = name
def printCompanyMessage(self): # self
print ( "Welcome to ", self.name , "! Parent Class ")
def printPersonalGreeting(self):
print ( "Hi", self.firstname, "thanks for requesting a quote!" )
def calcArea (self, l,w):
area = l*w
print ( "Area", area )
return area
def calcPrice(self, area):
carpetSQMPrice = 15.00
carpetPrice = carpetSQMPrice * area
return carpetPrice
def calcLabourPrice(self, area):
labourSQMPrice = 15.00
labourPrice = labourSQMPrice * area
return labourPrice
def calcTravelFee(self, distance):
fee =0
if distance < 10 :
fee = 0
elif distance > 10 and distance< 20 :
fee = 10
elif distance > 20 :
fee = 20
return fee