Question
Hello I need help modifying a code (please include screenshots of your formatted code) Take the code from problem 9.3 (below) that you developed and
Hello I need help modifying a code (please include screenshots of your formatted code)
Take the code from problem 9.3 (below) that you developed and put each class into a separate file. Modify your original program and classes to import the files you just created and get everything working properly.
class Clothing:
def __init__(self,size,color,quantity=1):
self.size=size
self.color=color
self.quantity=quantity
def printAttributes(self):
print("Size is "+str(self.size))
print("Color is "+self.color)
def increaseQuantity(self,quantity):
self.quantity+=quantity
def decreaseQuantity(self,quantity):
self.quantity-=quantity
class ShirtInherit(Clothing):
def __init__(self,size,color,shirtType,message):
super().__init__(size,color) #pass size and color to parent class Clothing
self.shirtType=shirtType
self.message=message
def printMessage(self):
print("Message on the shirt is "+self.message)
shirt=ShirtInherit(35,"blue","long","You are awesome")
Thank You!!!!!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started