-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcarpetfunction.py
More file actions
83 lines (61 loc) · 2.45 KB
/
Copy pathcarpetfunction.py
File metadata and controls
83 lines (61 loc) · 2.45 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# 1. create a class: class classname:
# 2. indent all functions
# 3. use the self parameter , 1st parameter in every function
# function library
class carpetfunction:
def __init__(self, p):
self.p = p
def printCompanyMessage(self):
print ( "Welcome to ABC Carpets!" )
def printPersonalGreeting(self,firstname):
print ( "Hi,", firstname.title(), ", thanks for requesting a quote!" )
def calcArea(self,l,w):
area = l*w
print ( "The Area is (Parent class): ", area )
return area
def calcCarpetPrice(self, area):
# sqm_price = 15 # get the sqmprice as a instance parameter
carpetprice = area * self.p # * sqm_price
print ( "Carpet Price (Parent class):", "%.2f" % carpetprice)
return carpetprice
# def __init__(self, sqm_p, labourprice):
# print ("Constructor of Parent Class")
# self.sqm_price =sqm_p
# self.labour_price = labourprice
# def setFirstName (self):
# firstname = input("Please enter your name: ")
# self.firstname = firstname
#
# def setWidth (self):
# w = float ( input ("What is the width?" ) )
# self.w = w
#
# def setLength(self):
# l = float ( input ("What is the length?") )
# self.l = l
#
# def getFirstName (self):
# return self.firstname
#
# def getWidth(self):
# return self.w
#
# def getLength(self):
# return self.l
## using self.LabourPrice i.e. instance / object variable set in __nint__
# def calcCarpetLabourPrice (self, area):
# LabourCarpetPrice = area * self.labour_price
# print ( "Labour Price to fit the carpet (Parent class): ", "%.2f" % LabourCarpetPrice)
#
#
## using self.LabourPrice i.e. instance / object variable set in __nint__
# def calcRemovalLabourPrice (self, area):
# RemovalLabourPrice = area * self.labour_price
# print ( "Labour Price removing old carpet (Parent class): ", "%.2f" % RemovalLabourPrice)
#
#
## using self.LabourPrice i.e. instance / object variable set in __nint__
# def calcCleaningLabourPrice (self, area):
# CleaningLabourPrice = area * self.labour_price
# print ( "Labour Price (Parent class): ", "%.2f" % CleaningLabourPrice)
#