Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions