Question: Create a class named SmartPhonePlan that extends the CellPhonePlan class and represents an advanced cell phone plan specifically designed for smartphones. This class inherits all
Create a class named SmartPhonePlan that extends the CellPhonePlan class and represents an advanced cell phone plan specifically designed for smartphones. This class inherits all the features of the CellPhonePlan and introduces data tracking capabilities to accommodate the data usage needs of smartphone users. The class is designed with the following properties and methods:
Properties:
maxdata: The maximum amount of data in gigabytes the plan allows at any time. This represents the starting total of data available to the user at the beginning of the plan's billing cycle.
dataused: The total amount of data in gigabytes consumed. This is deducted from maxdata to determine the remaining data available. At the beginning this should be
def initself network:dict, minutes:int, messages:int, data:int:
Initializes a new SmartPhonePlan instance with specified network, minutes, messages, and data.
Args:
network dict: A dictionary mapping phone numbers to phone objects.
minutes int: The total minutes provided by the plan.
messages int: The total SMS messages provided by the plan.
data int: The total data in gigabytes provided by the plan.
def usedataself data:int:
Consumes a specified amount of data from the plan's current total.
Args:
data int: The amount of data in gigabytes to be consumed.
Raises:
RuntimeError: If the phone plan does not have enough data for consumption.
NotImplementedError: If the receiving phone cannot receive messages.
def resetself:
Resets the plan's minutesmessages and data properties to their maximum values.
This method does not require arguments as it resets the plan's minutes, message counts, and data to maxminutes
maxmessages and maxdata respectively.
Make sure you include the PhonePlan and CellPhonePlan classes in your submitted code. Example:
class PhonePlan:
class CellPhonePlanPhonePlan:
class SmartPhonePlanCellPhonePlan:
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
