QUESTION ONE
- Create inheritance using MobilePhone as base class and Apple & Samsung as child class
- The base class should have properties:
- ScreenType = Touch Screen
- NetworkType = 4G/5G
- DualSim = True or False
- FrontCamera = (5MP/8MP/12MP/16MP)
- rearCamera = (8MP/12MP/16MP/32MP/48MP)
- RAM = (2GB/3GB/4GB)
- Storage = (16GB/32GB/64GB)
- Create basic mobile phone functionalities in the classes like: make_call, recieve_call, take_a_picture, etc.
- Use super() constructor for calling parent class’s constructor
- Make some objects of Apple class with different properties
- Make some objects of Samsung class with different properties [39 Marks] 3 | P a g e SECTION B QUESTION TWO What is the output of the following code: class BMW: def init(self, name, model, year): self.name = name self.model = model self.year = year def start(self): print("Starting the car ...") def stop(self): print("Stopping the car ...") def drive(self): pass class ThreeClass(BMW): def init(self, CuriseAssistEnabled, name, model, year): BMW.init(self, name, model, year) self.CuriseAssistEnabled = CuriseAssistEnabled def display(self): print(self.CuriseAssistEnabled) def drive(self): print("Three Class is being driven..") threeClass = ThreeClass(True, "BMW", "328i", 2018) print( threeClass.CuriseAssistEnabled, threeClass.name, threeClass.model, threeClass.year