Question: 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 threenon- self parameters. Assume caller and callee are Lines and that length

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!