Answered step by step
Verified Expert Solution
Question
1 Approved Answer
class Call: definit_(self, caller, callee, length):create/initialize instance variables for all three non- self parameters. Assume caller and callee are Lines and that length is an
class Call: definit_(self, caller, callee, length):create/initialize instance variables for all three non- self parameters. Assume caller and callee are Lines and that length is an integer. Check and raise CallError for the following cases: If either caller or callee is inactive, raise CallError with error message as in this example "line_703-9931530 (GMU CS)_not_active". If both caller and callee are inactive, only raise the error for caller o o If caller and callee are equivalent (with the same area_code and number), raise CallError with error message as in this example: "line 703-9931530 (GMU CS) cannot_callitself". o If length is negative, raise CallError with error message as in this example "negative call length:_-5". def__str_(self): create/return a string as in this example "Call (Line( 'GMU CS',703,9931530), Line(GMU',_703,_9931000), _20)" Hint: when obtaining strings for the lines, how can you rely upon str or repr definitions of lines to make this a short/trivial method to write? def _repr__(self): create/return a string identical to the__str__output def is_local (self) return True if both caller and callee have the same area_code; return False otherwise
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