Question: # Method: class Cart ( ) : def _ _ init _ _ ( self ) : self.cart = [ ] self.total = 0 def
# Method:
class Cart:
def initself:
self.cart
self.total
def addtocartself item:
self.cart.appenditem
self.total item.price
The following class Cart and method addtocart are parts of a larger program used by a mobile phone company. The method addtocart will work when an object of type MobileDevice or of type ServiceContract is passed to it State whether the method addtocart is a demonstration of the following items yesno and the reasoning sentences:
Inheritance
Polymorphism
ObjectOriented programming
Topdown design
Functional programming
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
